OpenStreetMap Nodes API

OSM node (point) operations

OpenAPI Specification

openstreetmap-nodes-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: OpenStreetMap API v0.6 Capabilities Nodes 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: Nodes
  description: OSM node (point) operations
paths:
  /node/{id}:
    get:
      operationId: getNode
      summary: Get node by ID
      description: Retrieve the current version of a node.
      tags:
      - Nodes
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        '200':
          description: Node data
          content:
            application/xml:
              schema:
                type: string
            application/json:
              schema:
                $ref: '#/components/schemas/Node'
        '404':
          description: Node not found (or deleted)
        '410':
          description: Node was deleted
    put:
      operationId: updateNode
      summary: Update a node
      description: Modify an existing node. Requires authentication and an open changeset.
      tags:
      - Nodes
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
          format: int64
      requestBody:
        required: true
        content:
          application/xml:
            schema:
              type: string
              description: OSM XML document with updated node
      responses:
        '200':
          description: New version number of the node
          content:
            text/plain:
              schema:
                type: integer
        '409':
          description: Changeset conflict or node version mismatch
        '412':
          description: Precondition failed (node is still in use by a way/relation)
    delete:
      operationId: deleteNode
      summary: Delete a node
      description: Mark a node as deleted in an open changeset.
      tags:
      - Nodes
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
          format: int64
      requestBody:
        required: true
        content:
          application/xml:
            schema:
              type: string
      responses:
        '200':
          description: New version number after deletion
          content:
            text/plain:
              schema:
                type: integer
  /node/create:
    put:
      operationId: createNode
      summary: Create a new node
      description: Create a new node within an open changeset.
      tags:
      - Nodes
      requestBody:
        required: true
        content:
          application/xml:
            schema:
              type: string
              description: OSM XML with the new node (use id=-1 for new)
      responses:
        '200':
          description: ID of the created node
          content:
            text/plain:
              schema:
                type: integer
        '400':
          description: Missing required fields or invalid geometry
        '405':
          description: The node is not inside the bounding box of the changeset
  /node/{id}/{version}:
    get:
      operationId: getNodeVersion
      summary: Get a specific version of a node
      description: Retrieve a historical version of a node.
      tags:
      - Nodes
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
          format: int64
      - name: version
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: Historical node version
          content:
            application/xml:
              schema:
                type: string
            application/json:
              schema:
                $ref: '#/components/schemas/Node'
components:
  schemas:
    Node:
      type: object
      description: An OSM node (a single geographic point)
      properties:
        type:
          type: string
          enum:
          - node
        id:
          type: integer
          format: int64
        lat:
          type: number
          format: double
          minimum: -90
          maximum: 90
        lon:
          type: number
          format: double
          minimum: -180
          maximum: 180
        tags:
          type: object
          additionalProperties:
            type: string
          description: Key-value metadata tags
        version:
          type: integer
        changeset:
          type: integer
          format: int64
        timestamp:
          type: string
          format: date-time
        user:
          type: string
        uid:
          type: integer
        visible:
          type: boolean
  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