Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5980083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:45:04+00:00 2026-05-22T21:45:04+00:00

How do I get coordinates from twitter geo/search? There are four coordinates in the

  • 0

How do I get coordinates from twitter geo/search? There are four coordinates in the JSON tree, but the result is array. How to? Thanks.

API URL : https://api.twitter.com/1/geo/search.json?query=tokyo //での取得結果

json[result]['places']['0']['name']=Tokyo
json[result]['places']['0']['bounding_box']['type']=Polygon
json[result]['places']['0']['bounding_box']['coordinates'][0][0]=Array  //Array data.

JSON tree

{
    "result": {
        "places": [
            {
                "name": "Tokyo",
                "bounding_box": {
                    "type": "Polygon",
                    "coordinates": [
                        [
                            [
                                138.942806388889,
                                24.222885
                            ],
                            [
                                142.248202222222,
                                24.222885
                            ],
                            [
                                142.248202222222,
                                35.8986897222222
                            ],
                            [
                                138.942806388889,
                                35.8986897222222
                            ]
                        ]
                    ]
                },
       ... // a long tree, something not important, hiden...

update

<?php
header('Content-type:text/html; charset=utf-8');
$url = "https://api.twitter.com/1/geo/search.json?query=tokyo";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Host: api.twitter.com'));
$body = curl_exec($ch);
curl_close ($ch);
$data = json_decode($body, true);
foreach ($data['result']['places'] as $data) {
    echo $data['bounding_box']['coordinates']['0']['0'].'<br />'; //array
}
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:45:04+00:00Added an answer on May 22, 2026 at 9:45 pm

    If you have JSON contents, you can use json_decode() function – it’ll return nice array you can read.

    http://php.net/manual/en/function.json-decode.php

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new in twitter api and now i try to get the geotagging from
I have an NSArray built from json data from twitter REST API. NSArray *dict
­I'm coding with API 8. I need to get coordinates X and Y from
I am trying to get the coordinates from a touch but I can't figure
Is there a way to get coordinates from a Location object in sexagesimal form
I'm trying to decode JSON received from twitter streaming API using JSONConvert from NewtonSoft.Json
Is there a way to retrieve text coordinates from PDF file on iPhone? Thanks,
i need to get the color at a particular coordinate from a texture. There
I'm attempting to get the coordinates from an instance of Goocanvas::Points in goocanvasmm. I
I'm currently trying to work out how to get world coordinates from JOGL -

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.