GeoDB Cities API

Integrating with Angular


Here are some options for executing GraphQL queries from Angular:


GeoDB Angular SDK

For the REST API, the easiest way to integrate the GeoDB service into your Angular app is by using the available client SDK

  1. cd
     into your Angular project root.
  2. npm install wft-geodb-angular-client@latest --save
  3. Update your AppModule.ts as follows:
      declarations: [
      imports: [
          apiKey: YOUR_RAPIDAPI_KEY,
      bootstrap: [AppComponent]
    export class AppModule { }
  4. In your Typescript class:
    constructor(private geoDbService: GeoDbService) { }
  5. Later on, in some method:
        someRequestParam: value,
        someOtherRequestParam: value,
        (response: GeoResponse) => {
            // Do your thing!
  6. Explore the Client SDK, including source code and a cookbook of examples.

RapidAPI Node.js SDK

In addition to our homegrown (and recommended) SDK, you may also opt to use the RapidAPI version.

The advantage of using RapidAPI's variant is you can use it to consume any API available on that platform. Also, if your Node.js app isn't based on Angular, you will again have to use this version.

The disadvantage is, because it serves as a lowest common denominator to all possible APIs, it's not tailored to the GeoDB domain and is not as user-friendly.