Geometry API

The Geometry API Union operation calculated union of pair or more geometries (polygons or multi-polygons) previously generated with Geoapify APIs. For example, you can calculate union of isolines.

The typical Union operation request URL looks like:


https://api.geoapify.com/v1/geometry?operation=union&id=2b9fdc45ae26402deb37fbf850b3872b&id=509ac02411371d301e01d76870133246&id=bb95e9cd0b10c41501c51fd6626aac79&apiKey=YOUR_API_KEY


  • operation - name of the operation. Possible values: "union", "intersection";
  • id - id of a geometry. The id is provided in the response of previously called API
  • apiKey - your Geoapify key

NOTE! A call to geometry API is charged as a call to Places or Geocoding API. However, one call is calculated for each geometry pair. So if you provide 4 ids in the request, it will be calculated as 3 requests.

Authentication and API key

To use the Geometry API, you'll need an API key. You can register and get a Geometry API Key for free without a credit card.

We offer a free plan, so there's no need to stress about cost. Start for free and upgrade to a paid plan when the needs of your project increase. For more information on our plans, visit the Pricing page.

How to get Geoapify API key

  1. Register on Geoapify MyProjects page
  2. Create a new project.
  3. Go to the API Keys section. One API key is generated automatically. You can generate multiple API keys per project if required.
  4. Optionally, you can protect the API key by listing allowed IP addresses, HTTP referrers, origins, and CORS.
  5. Choose "Geometry API" and an API key to generate a URL and programming code.
  6. Press the "Try" button to execute the API call and get the result object example.

API reference

Geometry API allows applying geometric operations (for example, union or intersection) to polygons and multi-polygons built with Geoapify APIs. The API works via HTTP Get request.

API URL


https://api.geoapify.com/v1/geometry


Request parameters

Name Description
apiKey Required parameter for API key
operation The applied operation. Possible values: "union", "intersection".
id Geometry id returned previously by one of the Geoapify APIs. The minimum required amount of ids is two.

NOTE! A call to geometry API is charged as a call to Places or Geocoding API. However, one call is calculated for each geometry pair. So if you provide 4 ids in the request, it will be calculated as 3 credits.

Response object

The response object contains a GeoJSON FeatureCollection object.

Name Description
type "FeatureCollection"
features Contains Feature objects of type "Multipolygon".
properties Contains id, which could be used to query the geometry later.
error Error object, containing the error description and details.

Pricing

The API call cost is calculated in credits. This helps us keep pricing simple and make our APIs universally usable:

API name Cost in credits Example
Geometry API 1 request = (NUMBER_OF_GEOMETRIES - 1) credits A union of 3 isilines costs 2 credits

Please choose from our various Pricing Plans to suit your needs, including a Free Plan with 3000 credits/day included.