2.0.3 • Published 12 months ago

wft-geodb-js-client v2.0.3

Weekly downloads
193
License
Creative Commons ...
Repository
-
Last release
12 months ago

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!

This SDK is automatically generated by the OpenAPI Generator project:

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

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

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

Finally, you need to build the module:

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:

npm install

Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:

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:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

Finally, you need to build the module:

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:

    npm install GIT_USER_ID/GIT_REPO_ID --save

For browser

The library also works in the browser environment via npm and browserify. 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):

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:

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

Getting Started

Please follow the installation instruction and execute the following JS code:

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

ClassMethodHTTP requestDescription
GeoDb.GeoApifindAdminDivisionsUsingGETGET /geo/adminDivisionsFind admin divisions
GeoDb.GeoApifindCitiesNearAdminDivisionUsingGETGET /geo/adminDivisions/{divisionId}/nearbyCitiesFind cities near division
GeoDb.GeoApifindCitiesNearCityUsingGETGET /geo/cities/{cityId}/nearbyCitiesFind cities near city
GeoDb.GeoApifindCitiesNearLocationUsingGETGET /geo/locations/{locationId}/nearbyCitiesFind cities near location
GeoDb.GeoApifindCitiesUsingGETGET /geo/citiesFind cities
GeoDb.GeoApifindCountryPlacesUsingGETGET /geo/countries/{countryId}/placesFind country places
GeoDb.GeoApifindDivisionsNearAdminDivisionUsingGETGET /geo/adminDivisions/{divisionId}/nearbyDivisionsFind admin divisions near division
GeoDb.GeoApifindDivisionsNearCityUsingGETGET /geo/cities/{cityId}/nearbyDivisionsFind admin divisions near city
GeoDb.GeoApifindDivisionsNearLocationUsingGETGET /geo/locations/{locationId}/nearbyDivisionsFind admin divisions near location
GeoDb.GeoApifindPlacesNearAdminDivisionUsingGETGET /geo/adminDivisions/{divisionId}/nearbyPlacesFind places near division
GeoDb.GeoApifindPlacesNearCityUsingGETGET /geo/cities/{cityId}/nearbyPlacesFind places near city
GeoDb.GeoApifindPlacesNearLocationUsingGETGET /geo/locations/{locationId}/nearbyPlacesFind places near location
GeoDb.GeoApifindPlacesNearPlaceUsingGETGET /geo/places/{placeId}/nearbyPlacesFind places near place
GeoDb.GeoApifindPlacesUsingGETGET /geo/placesFind places
GeoDb.GeoApifindRegionCitiesUsingGETGET /geo/countries/{countryId}/regions/{regionCode}/citiesFind country region cities
GeoDb.GeoApifindRegionDivisionsUsingGETGET /geo/countries/{countryId}/regions/{regionCode}/adminDivisionsFind country region administrative divisions
GeoDb.GeoApifindRegionPlacesUsingGETGET /geo/countries/{countryId}/regions/{regionCode}/placesFind country region places
GeoDb.GeoApigetAdminDivisionUsingGETGET /geo/adminDivisions/{divisionId}Get admin division details
GeoDb.GeoApigetCityDateTimeUsingGETGET /geo/cities/{cityId}/dateTimeGet city date-time
GeoDb.GeoApigetCityDistanceUsingGETGET /geo/cities/{cityId}/distanceGet city distance
GeoDb.GeoApigetCityLocatedInUsingGETGET /geo/cities/{cityId}/locatedInGet city containing region
GeoDb.GeoApigetCityTimeUsingGETGET /geo/cities/{cityId}/timeGet city time
GeoDb.GeoApigetCityUsingGETGET /geo/cities/{cityId}Get city details
GeoDb.GeoApigetCountriesUsingGETGET /geo/countriesFind countries
GeoDb.GeoApigetCountryUsingGETGET /geo/countries/{countryId}Get country details
GeoDb.GeoApigetPlaceDateTimeUsingGETGET /geo/places/{placeId}/dateTimeGet place date-time
GeoDb.GeoApigetPlaceDistanceUsingGETGET /geo/places/{placeId}/distanceGet place distance
GeoDb.GeoApigetPlaceLocatedInUsingGETGET /geo/places/{placeId}/locatedInGet place containing region
GeoDb.GeoApigetPlaceTimeUsingGETGET /geo/places/{placeId}/timeGet place time
GeoDb.GeoApigetPlaceUsingGETGET /geo/places/{placeId}Get place details
GeoDb.GeoApigetRegionUsingGETGET /geo/countries/{countryId}/regions/{regionCode}Get region details
GeoDb.GeoApigetRegionsUsingGETGET /geo/countries/{countryId}/regionsFind country regions
GeoDb.LocaleApigetCurrenciesUsingGETGET /locale/currenciesFind currencies
GeoDb.LocaleApigetLanguagesUsingGETGET /locale/languagesGet languages
GeoDb.LocaleApigetLocalesUsingGETGET /locale/localesGet locales
GeoDb.LocaleApigetTimeZoneDateTimeUsingGETGET /locale/timezones/{zoneId}/dateTimeGet time-zone date-time
GeoDb.LocaleApigetTimeZoneTimeUsingGETGET /locale/timezones/{zoneId}/timeGet time-zone time
GeoDb.LocaleApigetTimeZoneUsingGETGET /locale/timezones/{zoneId}Get time-zone
GeoDb.LocaleApigetTimezonesUsingGETGET /locale/timezonesGet time-zones

Documentation for Models

Documentation for Authorization

UserSecurity

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

12 months ago

2.0.2

12 months ago

2.0.1

12 months ago

2.0.0

1 year ago

1.6.0

1 year ago

1.5.0

2 years ago

1.4.9

2 years ago

1.4.8

3 years ago

1.4.7

3 years ago

1.4.6

3 years ago

1.4.5

3 years ago

1.4.4

3 years ago

1.4.3

3 years ago

1.4.2

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.4

5 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago