Geolocation

Geolocation is where the Everbase GraphQL API really shines. Thanks to our linked graph, we can derive data such as country info, exchange rates, languages and more using an IP address.

If you already have an IP address, you can query geolocation data like this:

{
  ipAddress(address: "1.1.1.1") {
    country {
      name
      languages {
        name
      }
    }
  }
}
{
  "data": {
    "ipAddress": {
      "country": {
        "name": "Australia",
        "languages": [
          {
            "name": "English"
          }
        ]
      }
    }
  }
}

But when using Everbase from a browser environment, we usually don't know the user's IP address. That's why there is the Client type that contains the IP address of the requesting device.

{
  client {
    ipAddress {
      address
      city {
        name
        population
        timeZone {
          name
        }
      }
      country {
        name
        currencies {
          name
          inGBP: convert(amount: 1, to: "GBP")
        }
      }
    }
  }
}
{
  "data": {
    "client": {
      "ipAddress": {
        "address": "2a02:8070:8988:0500:7285:c2ff:fec4:71a8",
        "city": {
          "name": "Reutlingen",
          "population": 115966,
          "timeZone": {
            "name": "UTC+01:00"
          }
        },
        "country": {
          "name": "Germany",
          "currencies": [
            {
              "name": "euro",
              "inGBP": 0.89653
            }
          ]
        }
      }
    }
  }
}

For more information, check out Client and IPAddress. To try your own queries, use the editor.