Documentation

Geo Location API Documentation


Endpoint

GET https://dash.pexi.nl/api/geo

Description

This API provides geographical information based on a specified location (city or country). The endpoint responds with geographical data for the given location.

Request Parameters

ParameterTypeRequiredDescription
locationStringYesThe name of the location (city or country) to query.
  • The location parameter should be passed as a query string in the URL.

Example Request

GET https://dash.pexi.nl/api/geo?location=Amsterdam

Response

The API returns a JSON object containing geographical data related to the specified location. Below is a sample response structure:

{
  "location": "Amsterdam",
  "country": "Netherlands",
  "latitude": 52.3676,
  "longitude": 4.9041,
  "timezone": "Europe/Amsterdam"
}

Response Fields

FieldTypeDescription
locationStringThe name of the requested location (city or country).
countryStringThe country where the location is found.
latitudeFloatThe latitude coordinate of the location.
longitudeFloatThe longitude coordinate of the location.
timezoneStringThe timezone associated with the location.

Error Responses

  • 400 Bad Request: If the location parameter is missing or invalid.
  • 404 Not Found: If the specified location is not recognized or unavailable.

Example Error Response

{
  "error": "Location not found"
}

Usage Notes

  • Ensure that the location parameter is URL-encoded if it contains spaces or special characters.
  • The API may support other formats for the location parameter, such as country codes.

This documentation should help users understand how to interact with the Geo Location API effectively.

Need Pexi now? Contact us!