### Forward Geocoding Source: https://github.com/api-evangelist/positionstack/blob/main/README.md Converts a given address into geographic coordinates (latitude and longitude). ```APIDOC ## GET /forward ### Description Converts a given address into geographic coordinates (latitude and longitude). ### Method GET ### Endpoint https://api.positionstack.com/v1/forward ### Parameters #### Query Parameters - **access_key** (string) - Required - Your API access key. - **query** (string) - Required - The address to geocode. - **limit** (integer) - Optional - The number of results to return. - **country** (string) - Optional - Restricts results to a specific country. - **forward_geocoding** (boolean) - Optional - Enables forward geocoding. - **reverse_geocoding** (boolean) - Optional - Enables reverse geocoding. - **point_distance** (integer) - Optional - Distance in km for reverse geocoding. - **output** (string) - Optional - The desired output format (e.g., JSON, XML, GeoJSON). ### Request Example ```json { "example": "https://api.positionstack.com/v1/forward?access_key=YOUR_ACCESS_KEY&query=1600 Pennsylvania Ave NW, Washington, DC" } ``` ### Response #### Success Response (200) - **data** (array) - An array of geocoding results. - **latitude** (number) - The latitude of the location. - **longitude** (number) - The longitude of the location. - **type** (string) - The type of the result (e.g., 'street_address', 'locality'). - **name** (string) - The name of the location. - **number** (string) - The street number. - **street** (string) - The street name. - **neighborhood** (string) - The neighborhood. - **postal_code** (string) - The postal code. - **region** (string) - The region or state. - **region_code** (string) - The region code. - **county** (string) - The county. - **country** (string) - The country. - **country_code** (string) - The country code. - **continent** (string) - The continent. - **label** (string) - A formatted address string. #### Response Example ```json { "example": { "data": [ { "latitude": 38.897675, "longitude": -77.03653, "type": "street_address", "name": "1600 Pennsylvania Avenue NW, Washington, DC 20500, United States", "number": "1600", "street": "Pennsylvania Avenue NW", "neighborhood": "Downtown", "postal_code": "20500", "region": "District of Columbia", "region_code": "DC", "county": "District of Columbia", "country": "United States", "country_code": "US", "continent": "North America", "label": "1600 Pennsylvania Avenue NW, Washington, DC 20500, United States" } ] } } ``` ``` -------------------------------- ### Reverse Geocoding Source: https://github.com/api-evangelist/positionstack/blob/main/README.md Converts geographic coordinates (latitude and longitude) into a human-readable address. ```APIDOC ## GET /reverse ### Description Converts geographic coordinates (latitude and longitude) into a human-readable address. ### Method GET ### Endpoint https://api.positionstack.com/v1/reverse ### Parameters #### Query Parameters - **access_key** (string) - Required - Your API access key. - **query** (string) - Required - The coordinates to geocode (e.g., '40.7128,-74.0060'). - **limit** (integer) - Optional - The number of results to return. - **country** (string) - Optional - Restricts results to a specific country. - **forward_geocoding** (boolean) - Optional - Enables forward geocoding. - **reverse_geocoding** (boolean) - Optional - Enables reverse geocoding. - **point_distance** (integer) - Optional - Distance in km for reverse geocoding. - **output** (string) - Optional - The desired output format (e.g., JSON, XML, GeoJSON). ### Request Example ```json { "example": "https://api.positionstack.com/v1/reverse?access_key=YOUR_ACCESS_KEY&query=40.7128,-74.0060" } ``` ### Response #### Success Response (200) - **data** (array) - An array of geocoding results. - **latitude** (number) - The latitude of the location. - **longitude** (number) - The longitude of the location. - **type** (string) - The type of the result (e.g., 'street_address', 'locality'). - **name** (string) - The name of the location. - **number** (string) - The street number. - **street** (string) - The street name. - **neighborhood** (string) - The neighborhood. - **postal_code** (string) - The postal code. - **region** (string) - The region or state. - **region_code** (string) - The region code. - **county** (string) - The county. - **country** (string) - The country. - **country_code** (string) - The country code. - **continent** (string) - The continent. - **label** (string) - A formatted address string. #### Response Example ```json { "example": { "data": [ { "latitude": 40.7128, "longitude": -74.0060, "type": "locality", "name": "New York", "number": null, "street": null, "neighborhood": null, "postal_code": null, "region": "New York", "region_code": "NY", "county": "New York County", "country": "United States", "country_code": "US", "continent": "North America", "label": "New York, NY, United States" } ] } } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.