Get Geographic Coordinates

Retrieve the latitude and longitude of a location name. Given this information you can fill the location-filter parameter in the news search endpoint.

GET
https://api.worldnewsapi.com/geo-coordinates

Parameters

Name Example Description
location
s r q
Tokyo, JapanThe address or name of the location.
api-key
s r q
abcd1234Your API key.
Example Request and Response
GET
https://api.worldnewsapi.com/geo-coordinates?location=Tokyo%2C%20Japan
{
  "latitude": 35.652832,
  "longitude": 139.839478,
  "city": "Tokyo"
}
cURL
Java
Javascript
Python
Go
C#
 Copy Codecurl -X GET 'https://api.worldnewsapi.com/geo-coordinates?location=Tokyo%2C%20Japan' \ -H 'x-api-key: myapikey'
 Copy Code
 Copy Code
 Copy Code
 Copy Code
 Copy Code

Headers

Response Headers:

  • Content-Type: application/json
  • X-API-Quota-Request: The number of points used by the request
  • X-API-Quota-Used: The number of points used in total today
  • X-API-Quota-Left: The number of points left today (depends on your plan)

Quotas

Calling this endpoint costs
1 point


Frequently Asked Questions

What does the Geo Coordinates endpoint return?

The Geo Coordinates endpoint returns latitude and longitude coordinates for a given location name. This is useful for converting place names into coordinates that can be used with the geo-search feature in the Search News endpoint.

How do I use coordinates to search for local news?

First, use the Geo Coordinates endpoint to get the latitude and longitude for your location. Then, pass those coordinates to the Search News endpoint using the location-filter parameter to find news published near that location.

What location formats are accepted?

You can provide location names in various formats such as city names (e.g., London), city and country combinations (e.g., Paris, France), or full addresses. The endpoint will attempt to geocode the location and return the best matching coordinates.


Questions? Need Help? Ask Away