OpenStreetMap Relations API

OSM relation operations

Operations 1

GET /relation/{id} Get relation by ID #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/openstreetmap-relations-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

openstreetmap-relations-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: OpenStreetMap API v0.6 Capabilities Relations API
  description: The OpenStreetMap main API v0.6 provides CRUD operations for map data editing including nodes, ways, relations, changesets, and notes. Requires OAuth 2.0 authentication for write operations. Maximum bounding box query area is 0.25 square degrees. Returns XML or JSON. Intended for editing, not high-volume read access.
  version: 0.6.0
  contact:
    name: OpenStreetMap Foundation
    url: https://osmfoundation.org/
  license:
    name: ODbL 1.0 (map data) / CC BY-SA 2.0 (tiles)
    url: https://www.openstreetmap.org/copyright
servers:
- url: https://api.openstreetmap.org/api/0.6
  description: OpenStreetMap production API
- url: https://master.apis.dev.openstreetmap.org/api/0.6
  description: OSM development/sandbox API
security:
- {}
- OAuth2:
  - read_prefs
  - write_api
  - write_notes
tags:
- name: Relations
  description: OSM relation operations
paths:
  /relation/{id}:
    get:
      operationId: getRelation
      summary: Get relation by ID
      description: Retrieve the current version of a relation with its members.
      tags:
      - Relations
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        '200':
          description: Relation data
          content:
            application/xml:
              schema:
                type: string
            application/json:
              schema:
                $ref: '#/components/schemas/Relation'
components:
  schemas:
    Relation:
      type: object
      description: An OSM relation (groups nodes, ways, or other relations)
      properties:
        type:
          type: string
          enum:
          - relation
        id:
          type: integer
          format: int64
        members:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                - node
                - way
                - relation
              ref:
                type: integer
                format: int64
              role:
                type: string
        tags:
          type: object
          additionalProperties:
            type: string
        version:
          type: integer
        changeset:
          type: integer
          format: int64
        timestamp:
          type: string
          format: date-time
  securitySchemes:
    OAuth2:
      type: oauth2
      description: OAuth 2.0 — required for write operations
      flows:
        authorizationCode:
          authorizationUrl: https://www.openstreetmap.org/oauth2/authorize
          tokenUrl: https://www.openstreetmap.org/oauth2/token
          scopes:
            read_prefs: Read user preferences
            write_prefs: Modify user preferences
            write_diary: Create diary entries
            write_api: Modify the map (nodes, ways, relations, changesets)
            read_gpx: Read private GPS traces
            write_gpx: Upload GPS traces
            write_notes: Create, comment on, and close notes
externalDocs:
  description: OSM API v0.6 Wiki
  url: https://wiki.openstreetmap.org/wiki/API_v0.6