### Find Places API Example Source: https://geodb-cities-api.wirefreethought.com/api-reference/find-cities-api This example demonstrates a basic GET request to the Find Places API, retrieving a limited number of places with default sorting. ```APIDOC ## GET /v1/geo/places ### Description Retrieves a list of places based on specified criteria. ### Method GET ### Endpoint /v1/geo/places ### Query Parameters - **limit** (integer) - Optional - The maximum number of results to return. - **offset** (integer) - Optional - The number of results to skip. - **namePrefix** (string) - Optional - Filters places by name prefix. - **countryIds** (string) - Optional - Filters places by country IDs. - **timezone** (string) - Optional - Filters places by timezone. - **type** (string) - Optional - Filters places by type (e.g., Admin Division, City, Island). - **minPopulation** (integer) - Optional - Filters places by minimum population. - **location** (string) - Optional - Filters places near a specific GPS location (format: 'lat+lon'). - **radius** (integer) - Optional - The radius in kilometers to search around the specified location. - **sort** (string) - Optional - The field to sort results by (e.g., Name, Population, Elevation, Country Code). Use 'A-Z' or 'Z-A' for order. - **language** (string) - Optional - The language for place names (e.g., 'en', 'fr', 'de'). ### Response #### Success Response (200) - **data** (array) - An array of place objects. - **name** (string) - The name of the place. - **population** (integer) - The population of the place. - **location** (object) - The geographical coordinates of the place. - **lat** (number) - Latitude. - **lon** (number) - Longitude. - **countryId** (string) - The ID of the country the place belongs to. - **countryName** (string) - The name of the country. - **region** (string) - The administrative region the place belongs to. ### Request Example ```http GET /v1/geo/places?limit=5&offset=0&sort=Population,HI-LO ``` ### Response Example ```json { "data": [ { "name": "Abu Dhabi", "population": 1570000, "location": {"lat": 24.451111111, "lon": 54.396944444}, "countryId": "AE", "countryName": "United Arab Emirates", "region": "Abu Dhabi" }, { "name": "Ajman", "population": 490035, "location": {"lat": 25.399444444, "lon": 55.479722222}, "countryId": "AE", "countryName": "United Arab Emirates", "region": "Ajman" } ], "metadata": { "currentOffset": 0, "totalCount": 6106 } } ``` ``` -------------------------------- ### GraphQL: Get Places by Name Prefix Source: https://geodb-cities-api.wirefreethought.com/docs/guides/getting-places-for-name-prefix Use the GraphQL API to query for populated places by providing a `namePrefix`. This example shows how to fetch the first 10 places starting with 'new', sorted by name. ```APIDOC ## GraphQL: Get Places by Name Prefix ### Description Use the GraphQL API to query for populated places by providing a `namePrefix`. This example shows how to fetch the first 10 places starting with 'new', sorted by name. ### Method POST ### Endpoint https://geodb-cities-graphql.p.rapidapi.com/ ### Query Parameters None (parameters are within the request body) ### Request Body ```json { "query": "{ populatedPlaces(namePrefix:\"new\", sort:\"name\", first:10) { totalCount pageInfo{ startCursor endCursor hasNextPage } edges { node { id name } } } }" } ``` ### Request Example ```bash curl --request POST \ --url https://geodb-cities-graphql.p.rapidapi.com/ \ --header 'content-type: application/json' \ --header 'x-rapidapi-host: geodb-cities-graphql.p.rapidapi.com' \ --header 'x-rapidapi-key: YOUR_API_KEY' \ --data '{"query":"{\n populatedPlaces(namePrefix:\"new\", sort:\"name\", first:10) {\n totalCount\n pageInfo{\n startCursor\n endCursor\n hasNextPage\n }\n edges {\n node {\n id\n name\n }\n }\n }\n}"}' ``` ### Response #### Success Response (200) - **totalCount** (integer) - The total number of places matching the query. - **pageInfo** (object) - Information about the current page of results. - **startCursor** (string) - The cursor for the first item in the current page. - **endCursor** (string) - The cursor for the last item in the current page. - **hasNextPage** (boolean) - Indicates if there are more pages of results. - **edges** (array) - A list of place edges. - **node** (object) - Represents a place. - **id** (string) - The unique identifier for the place. - **name** (string) - The name of the place. #### Response Example ```json { "data": { "populatedPlaces": { "totalCount": 100, "pageInfo": { "startCursor": "cursor1", "endCursor": "cursor10", "hasNextPage": true }, "edges": [ { "node": { "id": "Q2l0eTozNjQ3MjQ1", "name": "New York" } }, { "node": { "id": "Q2l0eTo1MTI1NzQx", "name": "Newark" } } ] } } } ``` ``` -------------------------------- ### REST: Get Places by Name Prefix Source: https://geodb-cities-api.wirefreethought.com/docs/guides/getting-places-for-name-prefix Use the REST API to retrieve places by specifying a `namePrefix` query parameter. This example fetches 10 places starting with 'new', sorted by name, starting from offset 0. ```APIDOC ## REST: Get Places by Name Prefix ### Description Use the REST API to retrieve places by specifying a `namePrefix` query parameter. This example fetches 10 places starting with 'new', sorted by name, starting from offset 0. ### Method GET ### Endpoint https://wft-geo-db.p.rapidapi.com/v1/geo/places ### Query Parameters - **namePrefix** (string) - Required - The prefix to filter place names by. - **sort** (string) - Optional - The field to sort the results by (e.g., 'name'). - **offset** (integer) - Optional - The number of results to skip (for pagination). - **limit** (integer) - Optional - The maximum number of results to return. ### Request Example ```bash curl --get --include 'https://wft-geo-db.p.rapidapi.com/v1/geo/places?namePrefix=new&sort=name&offset=0&limit=10' -H 'x-rapidapi-key: YOUR_API_KEY' -H 'x-rapidapi-host: wft-geo-db.p.rapidapi.com' ``` ### Response #### Success Response (200) - **data** (array) - A list of place objects matching the query. - Each place object contains fields like `id`, `name`, `country`, `region`, etc. #### Response Example ```json { "data": [ { "id": "Q2l0eTozNjQ3MjQ1", "wikiDataId": "Q60", "type": "CITY", "name": "New York", "country": "US", "countryCode": "USA", "region": "New York", "regionCode": "NY", "latitude": 40.71427, "longitude": -74.00597, "population": 8175133, "distance": 0 }, { "id": "Q2l0eTo1MTI1NzQx", "wikiDataId": "Q47150", "type": "CITY", "name": "Newark", "country": "US", "countryCode": "USA", "region": "New Jersey", "regionCode": "NJ", "latitude": 40.73566, "longitude": -74.17241, "population": 277115, "distance": 0 } ], "metadata": { "currentOffset": 0, "totalCount": 100 } } ``` ``` -------------------------------- ### Find Places API Request Example Source: https://geodb-cities-api.wirefreethought.com/docs/api/find-places This is a sample GET request to the Find Places API. It demonstrates how to retrieve a limited number of places with default offset. ```http GET /v1/geo/places?limit=5&offset=0 ``` -------------------------------- ### Get Currencies API Request Source: https://geodb-cities-api.wirefreethought.com/docs/api/get-currencies This is an example of a GET request to retrieve currencies. You can use query parameters like 'limit' and 'offset' to paginate the results. ```http GET /v1/locale/currencies?limit=5&offset=0 ``` -------------------------------- ### Install GeoDB Angular SDK Source: https://geodb-cities-api.wirefreethought.com/docs/guides/getting-started/integration/angular Install the GeoDB Angular client SDK using npm. Ensure you are in your Angular project's root directory. ```bash npm install wft-geodb-angular-client@latest --save ``` -------------------------------- ### REST API Source: https://geodb-cities-api.wirefreethought.com/docs/guides/getting-country-regions Fetch regions for a country using the REST API. This example retrieves the first 10 regions for the United States, starting from offset 0. ```APIDOC ## REST API ### Description Fetch regions for a country using the REST API. This example retrieves the first 10 regions for the United States, starting from offset 0. ### Method GET ### Endpoint https://wft-geo-db.p.rapidapi.com/v1/geo/countries/US/regions ### Query Parameters - **offset** (integer) - Optional - The starting offset for the results. - **limit** (integer) - Optional - The maximum number of results to return. ### Headers - `x-rapidapi-key`: `YOUR_API_KEY` - `x-rapidapi-host`: `wft-geo-db.p.rapidapi.com` ``` -------------------------------- ### Example cURL Request for Cities Source: https://geodb-cities-api.wirefreethought.com/docs/guides/getting-started/authentication This example demonstrates how to use cURL to find cities in the US and Canada with a population over 100,000, including the necessary authentication headers. ```curl curl --get --include 'https://wft-geo-db.p.rapidapi.com/v1/geo/cities?countryIds=US,CA&minPopulation=100000' \ -H 'X-RapidAPI-Key: YOUR_API_KEY' \ -H 'X-RapidAPI-Host: wft-geo-db.p.rapidapi.com' ``` -------------------------------- ### GraphQL Request Example Source: https://geodb-cities-api.wirefreethought.com/docs/guides/getting-distance-between-places This cURL command demonstrates how to send a GraphQL query to the GeoDB Cities API to get the distance between two places. Ensure you replace 'YOUR_API_KEY' with your valid RapidAPI key. ```bash curl --request POST \ --url https://geodb-cities-graphql.p.rapidapi.com/ \ --header 'content-type: application/json' \ --header 'x-rapidapi-host: geodb-cities-graphql.p.rapidapi.com' \ --header 'x-rapidapi-key: YOUR_API_KEY' \ --data '{"query":"QUERY"}' ``` -------------------------------- ### Get Currencies Source: https://geodb-cities-api.wirefreethought.com/ Retrieves a list of all supported currencies. ```APIDOC ## Get Currencies ### Description Retrieves a list of all supported currencies. ### Method GET ### Endpoint /currencies ### Parameters #### Query Parameters - **limit** (integer) - Optional - Limit the number of results returned. - **offset** (integer) - Optional - Offset the results by a specified amount. ### Response #### Success Response (200) - **data** (array) - An array of currency objects. - **code** (string) - The currency code (e.g., USD, EUR). - **name** (string) - The currency name (e.g., United States Dollar, Euro). ### Request Example ```http GET /currencies?limit=5 ``` ### Response Example ```json { "data": [ { "code": "USD", "name": "United States Dollar" }, { "code": "EUR", "name": "Euro" } ], "metadata": { "currentOffset": 0, "totalCount": 180 } } ``` ``` -------------------------------- ### REST API Free Tier Request Source: https://geodb-cities-api.wirefreethought.com/docs/api-reference/rest-api Example cURL command for making GET requests to the free tier of the REST API. Replace 'v1/some/geodb/endpoint?param1¶m2...' with your desired endpoint and parameters. ```bash curl --get --include 'http://geodb-free-service.wirefreethought.com/v1/some/geodb/endpoint?param1¶m2...' ``` -------------------------------- ### GET Request to Free Instance Source: https://geodb-cities-api.wirefreethought.com/docs/guides/getting-started/test-drive This snippet shows how to make a GET request to the free instance of the GeoDB Cities API to retrieve places. It's useful for quick testing without a subscription. ```http GET http://geodb-free-service.wirefreethought.com/v1/geo/places ``` -------------------------------- ### Find Country Places API Request Source: https://geodb-cities-api.wirefreethought.com/docs/api/find-country-places This is an example of a GET request to the Find-Country-Places API. It demonstrates how to specify a country ID and set parameters for limiting results and offsetting the data. ```http GET /v1/geo/countries/{countryId}/places?limit=5&offset=0 ``` -------------------------------- ### GraphQL API Source: https://geodb-cities-api.wirefreethought.com/docs/guides/getting-country-regions Retrieve regions for a specific country using the GraphQL endpoint. This example shows how to get the first 10 regions for the United States. ```APIDOC ## GraphQL API ### Description Retrieve regions for a specific country using the GraphQL endpoint. This example shows how to get the first 10 regions for the United States. ### Method POST ### Endpoint https://geodb-cities-graphql.p.rapidapi.com/ ### Request Body ```json { "query": "{\n country(id:\"US\") {\n regions(first:10) {\n totalCount\n pageInfo {\n startCursor\n endCursor\n hasNextPage\n }\n edges {\n node {\n name\n }\n }\n }\n }\n}" } ``` ### Headers - `content-type`: `application/json` - `x-rapidapi-host`: `geodb-cities-graphql.p.rapidapi.com` - `x-rapidapi-key`: `YOUR_API_KEY` ``` -------------------------------- ### Get Place Date-Time API Endpoint Source: https://geodb-cities-api.wirefreethought.com/docs/api/get-place-date-time Use this GET request to retrieve the current local date and time for a specified place. The response is formatted in ISO-8601. ```HTTP GET /v1/geo/places/{placeId}/dateTime ``` -------------------------------- ### Get Languages Source: https://geodb-cities-api.wirefreethought.com/ Retrieves a list of all supported languages. ```APIDOC ## Get Languages ### Description Retrieves a list of all supported languages. ### Method GET ### Endpoint /languages ### Parameters #### Query Parameters - **limit** (integer) - Optional - Limit the number of results returned. - **offset** (integer) - Optional - Offset the results by a specified amount. ### Response #### Success Response (200) - **data** (array) - An array of language objects. - **code** (string) - The language code (e.g., en, es). - **name** (string) - The language name (e.g., English, Spanish). ### Request Example ```http GET /languages?limit=5 ``` ### Response Example ```json { "data": [ { "code": "en", "name": "English" }, { "code": "es", "name": "Spanish" } ], "metadata": { "currentOffset": 0, "totalCount": 150 } } ``` ``` -------------------------------- ### Get Place Date-Time Source: https://geodb-cities-api.wirefreethought.com/entries.atom Retrieves the current date and time for a specified place. ```APIDOC ## GET /places/{placeId}/dateTime ### Description Gets the current date and time for a specified place. ### Method GET ### Endpoint /places/{placeId}/dateTime ``` -------------------------------- ### GraphQL Query Example: California Cities Source: https://geodb-cities-api.wirefreethought.com/docs/api-reference/rest-api An example GraphQL query to retrieve information about cities in California. This demonstrates how to query for country, region, and populated places. ```graphql { country(id:"US") { name region(code:"CA") { name populatedPlaces(first:10) { totalCount pageInfo { startCursor endCursor hasNextPage } edges { node { name } } } } } } ``` -------------------------------- ### Get Locales Source: https://geodb-cities-api.wirefreethought.com/ Retrieves a list of all supported locales. ```APIDOC ## Get Locales ### Description Retrieves a list of all supported locales. ### Method GET ### Endpoint /locales ### Parameters #### Query Parameters - **limit** (integer) - Optional - Limit the number of results returned. - **offset** (integer) - Optional - Offset the results by a specified amount. ### Response #### Success Response (200) - **data** (array) - An array of locale objects. - **code** (string) - The locale code (e.g., en, en-US). - **name** (string) - The locale name (e.g., English, English (United States)). - **languageCode** (string) - The associated language code. ### Request Example ```http GET /locales?limit=5 ``` ### Response Example ```json { "data": [ { "code": "en", "name": "English", "languageCode": "en" }, { "code": "en-US", "name": "English (United States)", "languageCode": "en" } ], "metadata": { "currentOffset": 0, "totalCount": 300 } } ``` ``` -------------------------------- ### Getting Countries Supporting A Specific Currency (REST) Source: https://geodb-cities-api.wirefreethought.com/docs/guides/getting-countries-for-currency This snippet shows how to use the REST API to get countries that support a specific currency code, like USD. It includes the cURL command with query parameters. ```APIDOC ## Getting Countries Supporting A Specific Currency (REST) ### Description Use this REST API endpoint to retrieve a list of countries that support a specific currency code. The example fetches countries supporting 'USD', with an offset of 0 and a limit of 10. ### Method GET ### Endpoint https://wft-geo-db.p.rapidapi.com/v1/geo/countries ### Query Parameters - **currencyCode** (string) - Required - The currency code (e.g., 'USD') to filter countries by. - **offset** (integer) - Optional - The number of results to skip. - **limit** (integer) - Optional - The maximum number of results to return. ### Request Example (cURL) ```bash curl --get --include 'https://wft-geo-db.p.rapidapi.com/v1/geo/countries?currencyCode=USD&offset=0&limit=10' \ -H 'x-rapidapi-key: YOUR_API_KEY' \ -H 'x-rapidapi-host: wft-geo-db.p.rapidapi.com' ``` ### Response #### Success Response (200) Returns a JSON object containing a list of countries that support the specified currency, including details like country name and code. ``` -------------------------------- ### Get Countries List via GraphQL Source: https://geodb-cities-api.wirefreethought.com/docs/guides/getting-countries Use this GraphQL query to fetch a list of countries. Ensure you include your API key in the headers. ```bash curl --request POST \ --url https://geodb-cities-graphql.p.rapidapi.com/ \ --header 'content-type: application/json' \ --header 'x-rapidapi-host: geodb-cities-graphql.p.rapidapi.com' \ --header 'x-rapidapi-key: YOUR_API_KEY' \ --data '{"query":"QUERY"}' ``` ```graphql { countries(first:10) { totalCount pageInfo{ startCursor endCursor hasNextPage } edges { node { wikiDataId name } } } } ``` -------------------------------- ### Get Timezones Source: https://geodb-cities-api.wirefreethought.com/ Retrieves a list of all supported timezones. ```APIDOC ## Get Timezones ### Description Retrieves a list of all supported timezones. ### Method GET ### Endpoint /timezones ### Parameters #### Query Parameters - **limit** (integer) - Optional - Limit the number of results returned. - **offset** (integer) - Optional - Offset the results by a specified amount. ### Response #### Success Response (200) - **data** (array) - An array of timezone objects. - **name** (string) - The timezone name (e.g., America/New_York). - **currentTime** (string) - The current time in that timezone (HH:MM:SS). - **utcOffset** (string) - The UTC offset (e.g., -04:00). ### Request Example ```http GET /timezones?limit=5 ``` ### Response Example ```json { "data": [ { "name": "America/New_York", "currentTime": "14:00:00", "utcOffset": "-04:00" }, { "name": "Europe/London", "currentTime": "19:00:00", "utcOffset": "+01:00" } ], "metadata": { "currentOffset": 0, "totalCount": 500 } } ``` ``` -------------------------------- ### Get Located In Source: https://geodb-cities-api.wirefreethought.com/entries.atom Finds the containing administrative region for a given city. ```APIDOC ## GET /geo/cities/:cityId/locatedIn ### Description Retrieves the containing administrative region (e.g., county) for a specified city. ### Method GET ### Endpoint /v1/geo/cities/:cityId/locatedIn ### Parameters #### Path Parameters - **cityId** (string) - Required - The ID of the city. ### Request Example ``` GET https://wft-geo-db.p.rapidapi.com/v1/geo/cities/Q60/locatedIn ``` ``` -------------------------------- ### Get Place Time Source: https://geodb-cities-api.wirefreethought.com/ Retrieves the current time for a specific place. ```APIDOC ## Get Place Time ### Description Retrieves the current time for a specific place. ### Method GET ### Endpoint /places/{placeId}/time ### Parameters #### Path Parameters - **placeId** (string) - Required - The ID of the place. ### Response #### Success Response (200) - **data** (object) - The time information. - **placeId** (string) - The ID of the place. - **timeZone** (string) - The timezone name. - **currentTime** (string) - The current time in HH:MM:SS format. ### Request Example ```http GET /places/ChIJN1t_t6O8woARr_h_0nB5_3A/time ``` ### Response Example ```json { "data": { "placeId": "ChIJN1t_t6O8woARr_h_0nB5_3A", "timeZone": "America/New_York", "currentTime": "14:00:00" } } ``` ``` -------------------------------- ### Get All Timezones Source: https://geodb-cities-api.wirefreethought.com/docs/api/get-time-zones Fetches a list of all available timezones. Supports pagination with limit and offset parameters. ```APIDOC ## GET /v1/locale/timezones ### Description Retrieves a list of all available timezones. This endpoint supports pagination to manage large result sets. ### Method GET ### Endpoint /v1/locale/timezones ### Parameters #### Query Parameters - **limit** (integer) - Optional - The maximum number of timezones to return per page. Defaults to a reasonable value if not specified. - **offset** (integer) - Optional - The number of timezones to skip before starting to collect the result set. Used for pagination. Defaults to 0. ### Response #### Success Response (200) - **Id** (string) - The unique identifier for the timezone (e.g., 'Asia__Aden'). - **Zone** (string) - The display name or standard name of the timezone (e.g., 'Arabian Standard Time'). - **Utc-offset-hours** (integer) - The offset of the timezone from Coordinated Universal Time (UTC) in hours. ``` -------------------------------- ### Get Languages Source: https://geodb-cities-api.wirefreethought.com/docs/api/get-languages Retrieves a list of supported languages. You can use the `limit` and `offset` query parameters to paginate the results. ```APIDOC ## GET /v1/locale/languages ### Description Retrieves a list of supported languages. ### Method GET ### Endpoint /v1/locale/languages ### Query Parameters - **limit** (integer) - Optional - The maximum number of languages to return. - **offset** (integer) - Optional - The number of languages to skip before starting to collect the result set. ``` -------------------------------- ### Get City Date-Time Source: https://geodb-cities-api.wirefreethought.com/entries/feature/get-city-timezone-data Retrieves the current date and time for a specific city, taking into account daylight saving time. ```APIDOC ## GET /v1/geo/cities/{cityId}/dateTime ### Description Returns the given city's date-time in ISO-8601 format, taking into account daylight savings. ### Method GET ### Endpoint /v1/geo/cities/{cityId}/dateTime ### Path Parameters - **cityId** (string) - Required - The unique identifier of the city. ### Request Example ```bash curl --get --include 'https://wft-geo-db.p.mashape.com/v1/geo/cities/Q1486/dateTime' \ -H 'X-Mashape-Key: YOUR_API_KEY' \ -H 'X-Mashape-Host: wft-geo-db.p.mashape.com' ``` ### Response #### Success Response (200) - **dateTime** (string) - The date and time in ISO-8601 format. #### Response Example { "dateTime": "2024-07-26T10:30:00Z" } ``` -------------------------------- ### Get Supported Languages Source: https://geodb-cities-api.wirefreethought.com/docs/api/get-languages Use this endpoint to retrieve a list of languages supported by the API. You can control the number of results with 'limit' and 'offset' parameters. ```http GET /v1/locale/languages?limit=5&offset=0 ``` -------------------------------- ### GraphQL Example Source: https://geodb-cities-api.wirefreethought.com/docs/guides/getting-places-for-multiple-filters This snippet shows how to query for places using multiple filters via the GraphQL API. It demonstrates filtering by name prefix, country IDs, and minimum population. ```APIDOC ## GraphQL ### Description Find places using a combination of different filters by specifying them as parameters in the GraphQL query. ### Method POST ### Endpoint https://geodb-cities-graphql.p.rapidapi.com/ ### Parameters #### Query Parameters (within the JSON payload) - **namePrefix** (string) - Optional - Only places whose names start with this prefix. - **countryIds** (array of strings) - Optional - Only places in these countries (country codes or wikiDataIds). - **minPopulation** (integer) - Optional - Only places having at least this population. - **excludedCountryIds** (array of strings) - Optional - Only places NOT in these countries (country codes or wikiDataIds). - **maxPopulation** (integer) - Optional - Only places having less than or equal to this population. - **location** (string) - Optional - Only places near this location. Latitude/longitude in ISO-6709 format: ±DD.DDDD±DDD.DDDD. - **timeZoneIds** (array of strings) - Optional - Only places in these time-zones (comma-delimited time-zone IDs). ### Request Example ```json { "query": "{ populatedPlaces(namePrefix:\"san\", countryIds:[\"US\",\"ES\"], minPopulation:100000, first:10) { totalCount pageInfo{ startCursor endCursor hasNextPage } edges { node { id name country { name } } } } }" } ``` ### Response #### Success Response (200) - **totalCount** (integer) - The total number of places matching the query. - **pageInfo** (object) - Information about the pagination. - **startCursor** (string) - The cursor for the first item in the current page. - **endCursor** (string) - The cursor for the last item in the current page. - **hasNextPage** (boolean) - Indicates if there is a next page of results. - **edges** (array) - A list of place edges. - **node** (object) - Represents a place. - **id** (string) - The unique identifier for the place. - **name** (string) - The name of the place. - **country** (object) - Information about the country the place belongs to. - **name** (string) - The name of the country. #### Response Example (Response structure will vary based on the query and results) ``` -------------------------------- ### REST Example Source: https://geodb-cities-api.wirefreethought.com/docs/guides/getting-places-for-multiple-filters This snippet shows how to query for places using multiple filters via the REST API. It demonstrates filtering by name prefix, minimum population, and country IDs. ```APIDOC ## REST ### Description Find places using a combination of different filters by specifying them as query parameters in the REST API request. ### Method GET ### Endpoint https://wft-geo-db.p.rapidapi.com/v1/geo/places ### Parameters #### Query Parameters - **namePrefix** (string) - Optional - Only places whose names start with this prefix. - **minPopulation** (integer) - Optional - Only places having at least this population. - **maxPopulation** (integer) - Optional - Only places having less than or equal to this population. - **countryIds** (string) - Optional - Only places in these countries (comma-delimited country codes or wikiDataIds). - **excludedCountryIds** (string) - Optional - Only places NOT in these countries (comma-delimited country codes or wikiDataIds). - **location** (string) - Optional - Only places near this location. Latitude/longitude in ISO-6709 format: ±DD.DDDD±DDD.DDDD. - **timeZoneIds** (string) - Optional - Only places in these time-zones (comma-delimited time-zone IDs). - **offset** (integer) - Optional - The offset to use for pagination. - **limit** (integer) - Optional - The limit for the number of results per page. ### Request Example ``` https://wft-geo-db.p.rapidapi.com/v1/geo/places?namePrefix=san&minPopulation=100000&countryIds=US,ES&offset=0&limit=10 ``` ### Response #### Success Response (200) (Response structure will vary based on the query parameters and results. Typically includes a list of places with their details.) #### Response Example (Response structure will vary based on the query and results) ``` -------------------------------- ### Use GeoDB Java SDK Source: https://geodb-cities-api.wirefreethought.com/docs/guides/getting-started/integration/java Instantiate and configure the GeoDB API client and then use it to execute service calls. ```java // Setup GeoDbApiClient apiClient = new GeoDbApiClient(); apiClient.setApiKey(YOUR_MASHAPE_KEY); GeoDbApi geoDbApi = new GeoDbApi(apiClient); // Execute service calls. geoDbApi.findCities(FindCitiesRequest.builder()...build()); ``` -------------------------------- ### Get Country Details API Endpoint Source: https://geodb-cities-api.wirefreethought.com/docs/api/get-country-details Use this GET request to retrieve details for a specific country by providing its ID. ```http GET /v1/geo/countries/{countryId} ``` -------------------------------- ### REST API Pro Tier Request Source: https://geodb-cities-api.wirefreethought.com/docs/api-reference/rest-api This cURL command demonstrates how to access the pro tier of the REST API. Remember to substitute 'YOUR_API_KEY' with your actual RapidAPI key. ```bash curl --get --include 'https://wft-geo-db.p.rapidapi.com/v1/some/geodb/endpoint?param1¶m2...' \ -H 'X-RapidAPI-Key: YOUR_API_KEY' \ -H 'x-RapidAPI-Host: wft-geo-db.p.rapidapi.com' ``` -------------------------------- ### Get All Locales API Request Source: https://geodb-cities-api.wirefreethought.com/docs/api/get-locales This snippet shows the HTTP GET request to retrieve a list of locales. You can specify 'limit' and 'offset' parameters to paginate the results. ```http GET /v1/locale/locales?limit=5&offset=0 ``` -------------------------------- ### REST API Request for Places by Name Prefix Source: https://geodb-cities-api.wirefreethought.com/docs/guides/getting-places-for-name-prefix This REST API call retrieves populated places that start with a specified prefix. It includes parameters for sorting and pagination. ```curl curl --get --include 'https://wft-geo-db.p.rapidapi.com/v1/geo/places?namePrefix=new&sort=name&offset=0&limit=10' \ -H 'x-rapidapi-key: YOUR_API_KEY' \ -H 'x-rapidapi-host: wft-geo-db.p.rapidapi.com' ``` -------------------------------- ### GraphQL Query for Places by Name Prefix Source: https://geodb-cities-api.wirefreethought.com/docs/guides/getting-places-for-name-prefix Use this GraphQL query to find populated places starting with a given prefix. Specify the prefix in the 'namePrefix' argument and set the desired limit. ```curl curl --request POST \ --url https://geodb-cities-graphql.p.rapidapi.com/ \ --header 'content-type: application/json' \ --header 'x-rapidapi-host: geodb-cities-graphql.p.rapidapi.com' \ --header 'x-rapidapi-key: YOUR_API_KEY' \ --data '{"query":"QUERY"}' ``` ```graphql { populatedPlaces(namePrefix:"new", sort:"name", first:10) { totalCount pageInfo{ startCursor endCursor hasNextPage } edges { node { id name } } } } ``` -------------------------------- ### Get Place Admin Region API Endpoint Source: https://geodb-cities-api.wirefreethought.com/docs/api/get-place-admin-region Use this GET endpoint to retrieve the administrative region for a specific place. Results depend on Wikidata data and may take a few seconds to appear. ```http GET /v1/geo/places/{placeId}/locatedIn ``` -------------------------------- ### Find Cities by Name Prefix Source: https://geodb-cities-api.wirefreethought.com/entries.atom Use this endpoint to find cities matching a name prefix, sorted by population. Useful for autocomplete features. ```http GET https://wft-geo-db.p.rapidapi.com/v1/geo/cities?namePrefix=Los&sort=-population&limit=10 ``` -------------------------------- ### Get Place Details Source: https://geodb-cities-api.wirefreethought.com/api-reference/get-city-details-api Returns the details for the given place, including name, country, region, elevation, population, GPS location, and time zone. Results can be displayed in multiple languages. ```APIDOC ## GET /v1/geo/places/{placeId} ### Description Retrieves the details for a specific place using its unique identifier. ### Method GET ### Endpoint /v1/geo/places/{placeId} ### Parameters #### Path Parameters - **placeId** (string) - Required - The unique identifier of the place. ### Response #### Success Response (200) - **name** (string) - The name of the place. - **country** (string) - The country the place belongs to. - **region** (string) - The region or state the place is located in. - **elevation** (number) - The elevation of the place in meters. - **population** (integer) - The population of the place. - **gpsLocation** (object) - GPS coordinates of the place. - **latitude** (number) - The latitude. - **longitude** (number) - The longitude. - **timeZone** (string) - The time zone of the place. ``` -------------------------------- ### Get City Time Source: https://geodb-cities-api.wirefreethought.com/entries/feature/get-city-timezone-data Retrieves the current time for a specific city in ISO-8601 format, considering daylight saving time. This endpoint is similar to 'Get City Date-Time' but focuses solely on the time component. ```curl curl --get --include 'https://wft-geo-db.p.mashape.com/v1/geo/cities/{cityId}/time' -H 'X-Mashape-Key: YOUR_API_KEY' -H 'X-Mashape-Host: wft-geo-db.p.mashape.com' ``` -------------------------------- ### Get Time-Zone Date-Time Source: https://geodb-cities-api.wirefreethought.com/entries/feature/get-city-timezone-data Returns the current date and time for a specified time zone ID in ISO-8601 format, including daylight saving adjustments. Use this to get the date-time for a general time zone rather than a specific city. ```curl curl --get --include 'https://wft-geo-db.p.mashape.com/v1/locale/timezones/{zoneId}/dateTime' -H 'X-Mashape-Key: YOUR_API_KEY' -H 'X-Mashape-Host: wft-geo-db.p.mashape.com' ``` -------------------------------- ### REST API Request for Countries by Currency Source: https://geodb-cities-api.wirefreethought.com/docs/guides/getting-countries-for-currency This cURL command shows how to use the REST API to retrieve countries that support a specific currency. It includes parameters for currency code, offset, and limit. Replace 'YOUR_API_KEY' with your actual RapidAPI key. ```curl curl --get --include 'https://wft-geo-db.p.rapidapi.com/v1/geo/countries?currencyCode=USD&offset=0&limit=10' \ -H 'x-rapidapi-key: YOUR_API_KEY' \ -H 'x-rapidapi-host: wft-geo-db.p.rapidapi.com' ``` -------------------------------- ### REST API Request for Places with Multiple Filters Source: https://geodb-cities-api.wirefreethought.com/docs/guides/getting-places-for-multiple-filters This cURL command demonstrates how to fetch places using multiple filters via the REST API. It searches for cities starting with 'san', with a minimum population of 100,000, and in the US or Spain. ```bash curl --get --include 'https://wft-geo-db.p.rapidapi.com/v1/geo/places?namePrefix=san&minPopulation=100000&countryIds=US,ES&offset=0&limit=10' -H 'x-rapidapi-key: YOUR_API_KEY' -H 'x-rapidapi-host: wft-geo-db.p.rapidapi.com' ``` -------------------------------- ### Sorting Results Syntax Source: https://geodb-cities-api.wirefreethought.com/docs/guides/getting-started/sorting-results Use the 'sort' parameter to specify sorting fields and order. Prefix fields with '-' for descending order. Multiple fields enable chained sorting. ```text sort=±SORT_FIELD_1,±SORT_FIELD_2,... ``` -------------------------------- ### Get Place Distance Source: https://geodb-cities-api.wirefreethought.com/ Calculates the distance between two places. ```APIDOC ## Get Place Distance ### Description Calculates the distance between two places. ### Method GET ### Endpoint /places/{placeId}/distance ### Parameters #### Path Parameters - **placeId** (string) - Required - The ID of the first place. #### Query Parameters - **toPlaceId** (string) - Required - The ID of the second place. ### Response #### Success Response (200) - **data** (object) - The distance information. - **fromPlaceId** (string) - The ID of the first place. - **toPlaceId** (string) - The ID of the second place. - **distance** (number) - The distance between the two places in kilometers. ### Request Example ```http GET /places/ChIJN1t_t6O8woARr_h_0nB5_3A/distance?toPlaceId=ChIJd8jPCj41j4AR-f-h_0nB5_3A ``` ### Response Example ```json { "data": { "fromPlaceId": "ChIJN1t_t6O8woARr_h_0nB5_3A", "toPlaceId": "ChIJd8jPCj41j4AR-f-h_0nB5_3A", "distance": 6.5 } } ``` ``` -------------------------------- ### Get Place Date-Time Source: https://geodb-cities-api.wirefreethought.com/docs/api/get-place-date-time Retrieves the current local date and time for a specified place, accounting for daylight saving time. The response is formatted in ISO-8601. ```APIDOC ## GET /v1/geo/places/{placeId}/dateTime ### Description Returns the given place's current local date-time, taking into account daylight savings. The response is returned in ISO-8601 format (yyyy-mm-ddThh:mm:ss). ### Method GET ### Endpoint /v1/geo/places/{placeId}/dateTime ### Parameters #### Path Parameters - **placeId** (string) - Required - The unique identifier of the place. ### Response #### Success Response (200) - **dateTime** (string) - The current local date and time in ISO-8601 format. ``` -------------------------------- ### GraphQL API Pro Tier Request Source: https://geodb-cities-api.wirefreethought.com/docs/api-reference/rest-api This cURL command is for the pro tier of the GraphQL API. Remember to replace 'YOUR_RAPIDAPI_KEY' with your actual API key. ```bash curl --request POST \ --url 'https://geodb-cities-graphql.p.rapidapi.com/graphql' \ --header 'content-type: application/json' \ --header 'x-rapidapi-host: geodb-cities-graphql.p.rapidapi.com' \ --header 'x-rapidapi-key: YOUR_RAPIDAPI_KEY' \ --data '{"query":QUERY"}' ``` -------------------------------- ### Get Timezone Time Source: https://geodb-cities-api.wirefreethought.com/ Retrieves the current time for a specific timezone. ```APIDOC ## Get Timezone Time ### Description Retrieves the current time for a specific timezone. ### Method GET ### Endpoint /timezones/{timezone}/time ### Parameters #### Path Parameters - **timezone** (string) - Required - The name of the timezone (e.g., America/New_York). ### Response #### Success Response (200) - **data** (object) - The time information. - **timezone** (string) - The timezone name. - **currentTime** (string) - The current time in HH:MM:SS format. ### Request Example ```http GET /timezones/America/New_York/time ``` ### Response Example ```json { "data": { "timezone": "America/New_York", "currentTime": "14:00:00" } } ``` ``` -------------------------------- ### Find Countries Source: https://geodb-cities-api.wirefreethought.com/ Retrieves a list of all supported countries. ```APIDOC ## Find Countries ### Description Retrieves a list of all supported countries. ### Method GET ### Endpoint /countries ### Parameters #### Query Parameters - **limit** (integer) - Optional - Limit the number of results returned. - **offset** (integer) - Optional - Offset the results by a specified amount. - **namePrefix** (string) - Optional - Filter countries by name prefix. - **continent** (string) - Optional - Filter countries by continent. - **countryId** (string) - Optional - Filter countries by country ID. - **countryName** (string) - Optional - Filter countries by country name. - **countryCode** (string) - Optional - Filter countries by country code. - **currencyCode** (string) - Optional - Filter countries by currency code. ### Response #### Success Response (200) - **data** (array) - An array of country objects. - **code** (string) - The country code. - **name** (string) - The country name. - **continentId** (string) - The ID of the continent. - **continentName** (string) - The name of the continent. - **isoNumeric** (string) - The ISO numeric code. ### Request Example ```http GET /countries?limit=10 ``` ### Response Example ```json { "data": [ { "code": "US", "name": "United States", "continentId": "NA", "continentName": "North America", "isoNumeric": "840" } ], "metadata": { "currentOffset": 0, "totalCount": 248 } } ``` ``` -------------------------------- ### Get Place Containing Region Source: https://geodb-cities-api.wirefreethought.com/entries.atom Retrieves the place that contains a specified region. ```APIDOC ## GET /places/{placeId}/locatedIn ### Description Gets the place that contains the specified region. ### Method GET ### Endpoint /places/{placeId}/locatedIn ``` -------------------------------- ### Get Timezone Date-Time Source: https://geodb-cities-api.wirefreethought.com/ Retrieves the current date and time for a specific timezone. ```APIDOC ## Get Timezone Date-Time ### Description Retrieves the current date and time for a specific timezone. ### Method GET ### Endpoint /timezones/{timezone}/datetime ### Parameters #### Path Parameters - **timezone** (string) - Required - The name of the timezone (e.g., America/New_York). ### Response #### Success Response (200) - **data** (object) - The date and time information. - **timezone** (string) - The timezone name. - **timestamp** (integer) - The current Unix timestamp. - **localTime** (string) - The local time in HH:MM:SS format. - **localDate** (string) - The local date in YYYY-MM-DD format. - **utcOffset** (string) - The UTC offset (e.g., +01:00). - **isDaylightSaving** (boolean) - Indicates if daylight saving is active. ### Request Example ```http GET /timezones/America/New_York/datetime ``` ### Response Example ```json { "data": { "timezone": "America/New_York", "timestamp": 1678886400, "localTime": "14:00:00", "localDate": "2023-03-15", "utcOffset": "-04:00", "isDaylightSaving": true } } ``` ```