Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Overpass API

No security coverage Under active development 1 sites

This module allows Drupal sites to query the Overpass API, which provides access to OpenStreetMap data. It includes error handling and retry mechanisms to ensure stable data retrieval, even from less reliable public API instances.

Provides API for querying Overpass API service, to use in other Drupal modules.

Module by default uses Overpass API public instance at url http://overpass-api.de/api/, which is slow and very unstable, so for active usage it is recommended to use other more robust and stable instance. Instruction how to launch your own Overpass Instance »

But this module tries to handle timeout problems and fatal errors on the endpoint side with multiple query repeats, to provide more stable work on Drupal API side.

Usage example:

$result = \Drupal::service('overpass_api')->query(<<<EOT
relation
  ["admin_level"="2"]
  ["type"="boundary"]
  ["boundary"="administrative"]
  ["ISO3166-1:alpha2"~"^..$"]
EOT);

It should return array of OSM elements like this:

array:216 [
  0 => {
    "type": "relation"
    "id": 60189
    "members": [...]
    "tags": {...}
  }
  ...
]

Requirements

  • Drupal 8 or higher.
  • PHP library spatie/data-transfer-object, should be installed automatically with Composer.

Configuration

Configuration form is located on /admin/config/system/overpass-api url, where you can configure Overpass API endpoint (default is pointing to public API http://overpass-api.de/api/), timeouts and other options.

Technical details

To prevent timeout errors and fatal problems on default Overpass API endpoint instance, in this module there are implemented correct handling of timeout problems, fatal errors like 429 Too Many Requests., 500 Gateway Timeout behind reverse proxy. and 504 Gateway Timeout., also memory overflow errors to provide more stable work.

Supporting this Module

You can convey gratitude to me for the development of the module and motivate me to do more through these services:

Ask your assistant about Overpass API

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Jul 2026
Latest release
2 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Releases

Version Type Core PHP Release date
1.0.0-beta4 Pre-release 10–11 Jul 13, 2026