Advance Data
Advanced Data
Embeddable Maps
Each API response will carry a map_url object containing a URL leading to an embeddable map associated with your geocoding result. This map can be embedded using an iframe element on your website or in your application.
Example map_url Object:
Please note: This feature is only available on the Basic Plan and higher.
Country Module
As part of the Country Module, the positionstack API is capable of returning an extensive set of country information along with both forward and reverse geocoding requests. To enable the Country Module, simply append the API's country_module HTTP GET parameter to your API request URL and set it to 1.
Example API Request:
Sign Up to Run API Request
Example country_module Object:
Please note: For readability purposes we have reduced the above example API response to show only one geocoding result and skipped any objects before and after the
country_moduleobject shown above.
country_module Sub-Objects Explained:
| Response Object | Description |
|---|---|
latitude | Returns the country's latitude coordinate. |
longitude | Returns the country's longitude coordinate. |
common_name | Returns the common name of the country associated with the location result. |
official_name | Returns the official name of the country associated with the location result. |
capital | Returns the capital of the country associated with the location result. |
flag | Returns a flag icon of the country associated with the location result. |
landlocked | Returns true or false depending on whether or not the country is landlocked. |
independent | Returns true or false depending on whether or not the country is independent. |
global > alpha2 | Returns the ISO 3166 Alpha 2 code of the country associated with the location result. |
global > alpha3 | Returns the ISO 3166 Alpha 3 code of the country associated with the location result. |
global > numeric_code | Returns the numeric ISO 3166 code of the country associated with the location result. |
global > region | Returns the country's region name. Example: Americas |
global > subregion | Returns the country's sub-region name. Example: Northern America |
global > world_region | Returns the country's world region name. Example: AMER |
global > region_code | Returns the country's region name. Example: Americas |
global > subregion_code | Returns the country's sub-region code. Example: 021 |
global > continent_name | Returns the continent name of the country associated with the location result. |
global > continent_code | Returns the continent code of the country associated with the location result. |
dial > calling_code | Returns the calling code of the country associated with the location result. |
dial > national_prefix | Returns the national calling prefix of the country associated with the location result. |
dial > international_prefix | Returns the international calling prefix of the country associated with the location result. |
currencies | Returns an array of one or multiple currencies associated with the location result. |
currencies > symbol | Returns the currency symbol of the country associated with the location result. |
currencies > code | Returns the currency code of the country associated with the location result. |
currencies > name | Returns the currency name of the country associated with the location result. |
currencies > numeric | Returns the numeric currency code of the country associated with the location result. |
currencies > minor_unit | Returns the minor currency unit of the country associated with the location result. |
languages | Returns an array of one or multiple languages of the country associated with the location result. |
languages > code | Returns the 2-letter language code of the given language. |
languages > name | Returns the official name of the given language. |
Sun Module
The API is capable of returning astrology data along with forward and reverse geocoding requests. To enable the Sun Module, simply append the API's sun_module HTTP GET parameter to your API request URL and set it to 1.
Example API Request:
Sign Up to Run API Request
Example sun_module Object:
Please note: For readability purposes we have reduced the above example API response to show only one geocoding result and skipped any objects before and after the
sun_moduleobject shown above.
sun_module Sub-Objects Explained:
| Response Object | Description |
|---|---|
rise > time | Returns the sunrise time as a UNIX timestamp (UTC). |
rise > astronomical | Returns the astronomical sunrise time as a UNIX timestamp (UTC). |
rise > civil | Returns the civil sunrise time as a UNIX timestamp (UTC). |
rise > nautical | Returns the nautical sunrise time as a UNIX timestamp (UTC). |
set > time | Returns the sunset time as a UNIX timestamp (UTC). |
set > astronomical | Returns the astronomical sunset time as a UNIX timestamp (UTC). |
set > civil | Returns the civil sunset time as a UNIX timestamp (UTC). |
set > nautical | Returns the nautical sunset time as a UNIX timestamp (UTC). |
transit | Returns the sun transit time as a UNIX timestamp (UTC). |
Timezone Module
The API is capable of returning timezone information along with forward and reverse geocoding requests. To enable the Timezone Module, simply append the API's timezone_module HTTP GET parameter to your API request URL and set it to 1.
Example API Request:
Sign Up to Run API Request
Example timezone_module Object:
Please note: For readability purposes we have reduced the above example API response to show only one geocoding result and skipped any objects before and after the
timezone_moduleobject shown above.
timezone_module Sub-Objects Explained:
| Response Object | Description |
|---|---|
name | Returns the common name of the timezone. |
offset_sec | Returns GMT offset of the timezone in seconds. |
name | Returns GMT offset of the timezone as a string. |
Bounding Box Module
For many geocoding requests the API is capable of returning accurate bounding box coordinates. To enable the Bounding Box Module, simply append the API's bbox_module HTTP GET parameter to your API request URL and set it to 1.
Not sure about what a bounding box is? Read OpenStreetMap's Bounding Box Definition.
Example API Request:
Sign Up to Run API Request
Example bbox_module Object:
Please note: For readability purposes we have reduced the above example API response to show only one geocoding result and skipped any objects before and after the
bbox_moduleobject shown above.
bbox_module Sub-Objects Explained:
| Response Object | Description |
|---|---|
min_longitude | Returns the minimum longitude coordinate point associated with the location result. |
min_latitude | Returns the minimum latitude coordinate point associated with the location result. |
max_longitude | Returns the maximum longitude coordinate point associated with the location result. |
max_latitude | Returns the maximum latitude coordinate point associated with the location result. |
Important: Please note that not all geocoding requests will yield bounding box information.