# wft-geodb-js-client

GeoDb - JavaScript client for wft-geodb-js-client
The GeoDB API focuses on getting global places and regions. Easily obtain country, region, and place data for use
in your apps! 
<ul>
  <li>Filter places by name prefix, country, location, time-zone, and even minimum population.</li>
  <li>Sort places by name, country code, elevation, and population - or any combination of these.</li> 
  <li>Get all country regions.</li> <li>Get all places in a given country or region.</li>
  <li>
    Display results in multiple languages.</li> <li>RESTful API adheres to industry best-practices, including
    HATEOAS-style links to facilitate paging results.
  </li> 
  <li>Backed by cloud-based load-balanced infrastructure.</li>
  <li>Data is periodically refreshed from GeoNames and WikiData.</li>
</ul>
<p>Notes:
<ul>
  <li>
    Since the database is periodically updated, this may <strong>very rarely</strong> result in certain places
    being marked deleted (e.g., duplicates removed). By default, endpoints returning place data will exclude
    places marked deleted. However, in the unlikely event that this occurs while your app is paging through a set
    of affected results - and you care about the paged results suddenly changing underneath - specify 
    <tt>includeDeleted=SINCE_YESTERDAY</tt> (or <tt>SINCE_LAST_WEEK</tt> if you're really paranoid!).
  </li>
</ul>
<hr/>
<h3>Useful Resources</h3>
<ul>
  <li>
    SDKs
    <ul>
      <li>
        <a href='https://www.npmjs.com/package/wft-geodb-angular-client'>Angular</a>, 
        <a href='https://github.com/wirefreethought/geodb-sample-angular-app'>Sample App</a>
      </li>
      <li><a href='https://github.com/wirefreethought/geodb-java-client'>Java</a></li>
      <li><a href='https://www.npmjs.com/package/wft-geodb-js-client'>JavaScript</a></li>
    </ul>
    <li><a href='swagger.json'>Swagger Docs</a></li>
    <li><a href='http://creativecommons.org/licenses/by/3.0/'>Usage License</a></li>
  </li>      
</ul>

This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 1.0.0
- Package version: 2.0.3
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen

## Installation

### For [Node.js](https://nodejs.org/)

#### npm

To publish the library as a [npm](https://www.npmjs.com/), please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages).

Then install it via:

```shell
npm install wft-geodb-js-client --save
```

Finally, you need to build the module:

```shell
npm run build
```

##### Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing `package.json` (and this README). Let's call this `JAVASCRIPT_CLIENT_DIR`. Then run:

```shell
npm install
```

Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the following, also from `JAVASCRIPT_CLIENT_DIR`:

```shell
npm link
```

To use the link you just defined in your project, switch to the directory you want to use your wft-geodb-js-client from, and run:

```shell
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
```

Finally, you need to build the module:

```shell
npm run build
```

#### git

If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID
then install it via:

```shell
    npm install GIT_USER_ID/GIT_REPO_ID --save
```

### For browser

The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following
the above steps with Node.js and installing browserify with `npm install -g browserify`,
perform the following (assuming *main.js* is your entry file):

```shell
browserify main.js > bundle.js
```

Then include *bundle.js* in the HTML pages.

### Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error:
Cannot resolve module", most certainly you should disable AMD loader. Add/merge
the following section to your webpack config:

```javascript
module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}
```

## Getting Started

Please follow the [installation](#installation) instruction and execute the following JS code:

```javascript
var GeoDb = require('wft-geodb-js-client');

var defaultClient = GeoDb.ApiClient.instance;
// Configure API key authorization: UserSecurity
var UserSecurity = defaultClient.authentications['UserSecurity'];
UserSecurity.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//UserSecurity.apiKeyPrefix['X-RapidAPI-Key'] = "Token"

var api = new GeoDb.GeoApi()
var opts = {
  'location': "location_example", // {String} Only places near this location. Latitude/longitude in ISO-6709 format: ±DD.DDDD±DDD.DDDD
  'radius': 56, // {Number} The location radius within which to find places
  'distanceUnit': "'MI'", // {String} The unit of distance: MI | KM
  'countryIds': "countryIds_example", // {String} Only places in these countries (comma-delimited country codes or WikiData ids)
  'excludedCountryIds': "excludedCountryIds_example", // {String} Only places NOT in these countries (comma-delimited country codes or WikiData ids)
  'minPopulation': 56, // {Number} Only places having at least this population
  'maxPopulation': 56, // {Number} Only places having no more than this population
  'namePrefix': "namePrefix_example", // {String} Only entities whose names start with this prefix. If languageCode is set, the prefix will be matched on the name as it appears in that language. 
  'namePrefixDefaultLangResults': true, // {Boolean} When name-prefix matching, whether or not to match on names in the default language if a non-default languageCode is set. 
  'timeZoneIds': "timeZoneIds_example", // {String} Only places in these time-zones (comma-delimited)
  'asciiMode': false, // {Boolean} Display results using ASCII characters
  'hateoasMode': true, // {Boolean} Include HATEOAS-style links in results
  'languageCode': "languageCode_example", // {String} Display results in this language
  'limit': 10, // {Number} The maximum number of results to retrieve
  'offset': 0, // {Number} The zero-ary offset index into the results
  'sort': "sort_example", // {String} How to sort places.  Format: ±SORT_FIELD,±SORT_FIELD  where SORT_FIELD = countryCode | elevation | name | population 
  'includeDeleted': "'NONE'" // {String} Whether to include any divisions marked deleted: ALL | SINCE_YESTERDAY | SINCE_LAST_WEEK | NONE
};
api.findAdminDivisionsUsingGET(opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});


```

## Documentation for API Endpoints

All URIs are relative to *https://wft-geo-db.p.rapidapi.com/v1*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*GeoDb.GeoApi* | [**findAdminDivisionsUsingGET**](docs/GeoApi.md#findAdminDivisionsUsingGET) | **GET** /geo/adminDivisions | Find admin divisions
*GeoDb.GeoApi* | [**findCitiesNearAdminDivisionUsingGET**](docs/GeoApi.md#findCitiesNearAdminDivisionUsingGET) | **GET** /geo/adminDivisions/{divisionId}/nearbyCities | Find cities near division
*GeoDb.GeoApi* | [**findCitiesNearCityUsingGET**](docs/GeoApi.md#findCitiesNearCityUsingGET) | **GET** /geo/cities/{cityId}/nearbyCities | Find cities near city
*GeoDb.GeoApi* | [**findCitiesNearLocationUsingGET**](docs/GeoApi.md#findCitiesNearLocationUsingGET) | **GET** /geo/locations/{locationId}/nearbyCities | Find cities near location
*GeoDb.GeoApi* | [**findCitiesUsingGET**](docs/GeoApi.md#findCitiesUsingGET) | **GET** /geo/cities | Find cities
*GeoDb.GeoApi* | [**findCountryPlacesUsingGET**](docs/GeoApi.md#findCountryPlacesUsingGET) | **GET** /geo/countries/{countryId}/places | Find country places
*GeoDb.GeoApi* | [**findDivisionsNearAdminDivisionUsingGET**](docs/GeoApi.md#findDivisionsNearAdminDivisionUsingGET) | **GET** /geo/adminDivisions/{divisionId}/nearbyDivisions | Find admin divisions near division
*GeoDb.GeoApi* | [**findDivisionsNearCityUsingGET**](docs/GeoApi.md#findDivisionsNearCityUsingGET) | **GET** /geo/cities/{cityId}/nearbyDivisions | Find admin divisions near city
*GeoDb.GeoApi* | [**findDivisionsNearLocationUsingGET**](docs/GeoApi.md#findDivisionsNearLocationUsingGET) | **GET** /geo/locations/{locationId}/nearbyDivisions | Find admin divisions near location
*GeoDb.GeoApi* | [**findPlacesNearAdminDivisionUsingGET**](docs/GeoApi.md#findPlacesNearAdminDivisionUsingGET) | **GET** /geo/adminDivisions/{divisionId}/nearbyPlaces | Find places near division
*GeoDb.GeoApi* | [**findPlacesNearCityUsingGET**](docs/GeoApi.md#findPlacesNearCityUsingGET) | **GET** /geo/cities/{cityId}/nearbyPlaces | Find places near city
*GeoDb.GeoApi* | [**findPlacesNearLocationUsingGET**](docs/GeoApi.md#findPlacesNearLocationUsingGET) | **GET** /geo/locations/{locationId}/nearbyPlaces | Find places near location
*GeoDb.GeoApi* | [**findPlacesNearPlaceUsingGET**](docs/GeoApi.md#findPlacesNearPlaceUsingGET) | **GET** /geo/places/{placeId}/nearbyPlaces | Find places near place
*GeoDb.GeoApi* | [**findPlacesUsingGET**](docs/GeoApi.md#findPlacesUsingGET) | **GET** /geo/places | Find places
*GeoDb.GeoApi* | [**findRegionCitiesUsingGET**](docs/GeoApi.md#findRegionCitiesUsingGET) | **GET** /geo/countries/{countryId}/regions/{regionCode}/cities | Find country region cities
*GeoDb.GeoApi* | [**findRegionDivisionsUsingGET**](docs/GeoApi.md#findRegionDivisionsUsingGET) | **GET** /geo/countries/{countryId}/regions/{regionCode}/adminDivisions | Find country region administrative divisions
*GeoDb.GeoApi* | [**findRegionPlacesUsingGET**](docs/GeoApi.md#findRegionPlacesUsingGET) | **GET** /geo/countries/{countryId}/regions/{regionCode}/places | Find country region places
*GeoDb.GeoApi* | [**getAdminDivisionUsingGET**](docs/GeoApi.md#getAdminDivisionUsingGET) | **GET** /geo/adminDivisions/{divisionId} | Get admin division details
*GeoDb.GeoApi* | [**getCityDateTimeUsingGET**](docs/GeoApi.md#getCityDateTimeUsingGET) | **GET** /geo/cities/{cityId}/dateTime | Get city date-time
*GeoDb.GeoApi* | [**getCityDistanceUsingGET**](docs/GeoApi.md#getCityDistanceUsingGET) | **GET** /geo/cities/{cityId}/distance | Get city distance
*GeoDb.GeoApi* | [**getCityLocatedInUsingGET**](docs/GeoApi.md#getCityLocatedInUsingGET) | **GET** /geo/cities/{cityId}/locatedIn | Get city containing region
*GeoDb.GeoApi* | [**getCityTimeUsingGET**](docs/GeoApi.md#getCityTimeUsingGET) | **GET** /geo/cities/{cityId}/time | Get city time
*GeoDb.GeoApi* | [**getCityUsingGET**](docs/GeoApi.md#getCityUsingGET) | **GET** /geo/cities/{cityId} | Get city details
*GeoDb.GeoApi* | [**getCountriesUsingGET**](docs/GeoApi.md#getCountriesUsingGET) | **GET** /geo/countries | Find countries
*GeoDb.GeoApi* | [**getCountryUsingGET**](docs/GeoApi.md#getCountryUsingGET) | **GET** /geo/countries/{countryId} | Get country details
*GeoDb.GeoApi* | [**getPlaceDateTimeUsingGET**](docs/GeoApi.md#getPlaceDateTimeUsingGET) | **GET** /geo/places/{placeId}/dateTime | Get place date-time
*GeoDb.GeoApi* | [**getPlaceDistanceUsingGET**](docs/GeoApi.md#getPlaceDistanceUsingGET) | **GET** /geo/places/{placeId}/distance | Get place distance
*GeoDb.GeoApi* | [**getPlaceLocatedInUsingGET**](docs/GeoApi.md#getPlaceLocatedInUsingGET) | **GET** /geo/places/{placeId}/locatedIn | Get place containing region
*GeoDb.GeoApi* | [**getPlaceTimeUsingGET**](docs/GeoApi.md#getPlaceTimeUsingGET) | **GET** /geo/places/{placeId}/time | Get place time
*GeoDb.GeoApi* | [**getPlaceUsingGET**](docs/GeoApi.md#getPlaceUsingGET) | **GET** /geo/places/{placeId} | Get place details
*GeoDb.GeoApi* | [**getRegionUsingGET**](docs/GeoApi.md#getRegionUsingGET) | **GET** /geo/countries/{countryId}/regions/{regionCode} | Get region details
*GeoDb.GeoApi* | [**getRegionsUsingGET**](docs/GeoApi.md#getRegionsUsingGET) | **GET** /geo/countries/{countryId}/regions | Find country regions
*GeoDb.LocaleApi* | [**getCurrenciesUsingGET**](docs/LocaleApi.md#getCurrenciesUsingGET) | **GET** /locale/currencies | Find currencies
*GeoDb.LocaleApi* | [**getLanguagesUsingGET**](docs/LocaleApi.md#getLanguagesUsingGET) | **GET** /locale/languages | Get languages
*GeoDb.LocaleApi* | [**getLocalesUsingGET**](docs/LocaleApi.md#getLocalesUsingGET) | **GET** /locale/locales | Get locales
*GeoDb.LocaleApi* | [**getTimeZoneDateTimeUsingGET**](docs/LocaleApi.md#getTimeZoneDateTimeUsingGET) | **GET** /locale/timezones/{zoneId}/dateTime | Get time-zone date-time
*GeoDb.LocaleApi* | [**getTimeZoneTimeUsingGET**](docs/LocaleApi.md#getTimeZoneTimeUsingGET) | **GET** /locale/timezones/{zoneId}/time | Get time-zone time
*GeoDb.LocaleApi* | [**getTimeZoneUsingGET**](docs/LocaleApi.md#getTimeZoneUsingGET) | **GET** /locale/timezones/{zoneId} | Get time-zone
*GeoDb.LocaleApi* | [**getTimezonesUsingGET**](docs/LocaleApi.md#getTimezonesUsingGET) | **GET** /locale/timezones | Get time-zones


## Documentation for Models

 - [GeoDb.BadRequestResponse](docs/BadRequestResponse.md)
 - [GeoDb.BaseCollectionResponse](docs/BaseCollectionResponse.md)
 - [GeoDb.BaseCollectionResponseAllOf](docs/BaseCollectionResponseAllOf.md)
 - [GeoDb.BaseResponse](docs/BaseResponse.md)
 - [GeoDb.CountriesResponse](docs/CountriesResponse.md)
 - [GeoDb.CountriesResponseAllOf](docs/CountriesResponseAllOf.md)
 - [GeoDb.CountryDetails](docs/CountryDetails.md)
 - [GeoDb.CountryResponse](docs/CountryResponse.md)
 - [GeoDb.CountryResponseAllOf](docs/CountryResponseAllOf.md)
 - [GeoDb.CountrySummary](docs/CountrySummary.md)
 - [GeoDb.CurrenciesResponse](docs/CurrenciesResponse.md)
 - [GeoDb.CurrenciesResponseAllOf](docs/CurrenciesResponseAllOf.md)
 - [GeoDb.Currency](docs/Currency.md)
 - [GeoDb.DateTimeResponse](docs/DateTimeResponse.md)
 - [GeoDb.DateTimeResponseAllOf](docs/DateTimeResponseAllOf.md)
 - [GeoDb.DistanceResponse](docs/DistanceResponse.md)
 - [GeoDb.DistanceResponseAllOf](docs/DistanceResponseAllOf.md)
 - [GeoDb.Error](docs/Error.md)
 - [GeoDb.ErrorCode](docs/ErrorCode.md)
 - [GeoDb.ForbiddenResponse](docs/ForbiddenResponse.md)
 - [GeoDb.LanguageDescriptor](docs/LanguageDescriptor.md)
 - [GeoDb.LanguagesResponse](docs/LanguagesResponse.md)
 - [GeoDb.LanguagesResponseAllOf](docs/LanguagesResponseAllOf.md)
 - [GeoDb.Link](docs/Link.md)
 - [GeoDb.Locale](docs/Locale.md)
 - [GeoDb.LocalesResponse](docs/LocalesResponse.md)
 - [GeoDb.LocalesResponseAllOf](docs/LocalesResponseAllOf.md)
 - [GeoDb.Metadata](docs/Metadata.md)
 - [GeoDb.NotFoundResponse](docs/NotFoundResponse.md)
 - [GeoDb.PopulatedPlaceDetails](docs/PopulatedPlaceDetails.md)
 - [GeoDb.PopulatedPlaceResponse](docs/PopulatedPlaceResponse.md)
 - [GeoDb.PopulatedPlaceResponseAllOf](docs/PopulatedPlaceResponseAllOf.md)
 - [GeoDb.PopulatedPlaceSummary](docs/PopulatedPlaceSummary.md)
 - [GeoDb.PopulatedPlaceType](docs/PopulatedPlaceType.md)
 - [GeoDb.PopulatedPlacesResponse](docs/PopulatedPlacesResponse.md)
 - [GeoDb.PopulatedPlacesResponseAllOf](docs/PopulatedPlacesResponseAllOf.md)
 - [GeoDb.RegionDetails](docs/RegionDetails.md)
 - [GeoDb.RegionResponse](docs/RegionResponse.md)
 - [GeoDb.RegionResponseAllOf](docs/RegionResponseAllOf.md)
 - [GeoDb.RegionSummary](docs/RegionSummary.md)
 - [GeoDb.RegionsResponse](docs/RegionsResponse.md)
 - [GeoDb.RegionsResponseAllOf](docs/RegionsResponseAllOf.md)
 - [GeoDb.TimeResponse](docs/TimeResponse.md)
 - [GeoDb.TimeResponseAllOf](docs/TimeResponseAllOf.md)
 - [GeoDb.TimeZoneDescriptor](docs/TimeZoneDescriptor.md)
 - [GeoDb.TimeZoneResponse](docs/TimeZoneResponse.md)
 - [GeoDb.TimeZoneResponseAllOf](docs/TimeZoneResponseAllOf.md)
 - [GeoDb.TimeZonesResponse](docs/TimeZonesResponse.md)
 - [GeoDb.TimeZonesResponseAllOf](docs/TimeZonesResponseAllOf.md)


## Documentation for Authorization



### UserSecurity


- **Type**: API key
- **API key parameter name**: X-RapidAPI-Key
- **Location**: HTTP header

