OpenStreetMap Notes API

Community map notes

OpenAPI Specification

openstreetmap-notes-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: OpenStreetMap API v0.6 Capabilities Notes 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: Notes
  description: Community map notes
paths:
  /notes:
    get:
      operationId: searchNotes
      summary: Search notes
      description: Search OSM notes by bounding box, text, status, or user.
      tags:
      - Notes
      parameters:
      - name: bbox
        in: query
        schema:
          type: string
        description: Bounding box (min_lon,min_lat,max_lon,max_lat)
      - name: q
        in: query
        schema:
          type: string
        description: Free text search
      - name: status
        in: query
        schema:
          type: string
          enum:
          - open
          - closed
          - all
          default: open
      - name: limit
        in: query
        schema:
          type: integer
          default: 100
          maximum: 10000
      - name: closed
        in: query
        schema:
          type: integer
          default: 7
          description: Number of days a note must be closed to be excluded (-1 = include all closed)
      responses:
        '200':
          description: Notes matching the query
          content:
            application/xml:
              schema:
                type: string
            application/json:
              schema:
                $ref: '#/components/schemas/NoteCollection'
    post:
      operationId: createNote
      summary: Create a note
      description: Create a new map note at a geographic location.
      tags:
      - Notes
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
              - lat
              - lon
              - text
              properties:
                lat:
                  type: number
                  format: double
                  minimum: -90
                  maximum: 90
                lon:
                  type: number
                  format: double
                  minimum: -180
                  maximum: 180
                text:
                  type: string
                  minLength: 1
                  maxLength: 2000
      responses:
        '200':
          description: Created note
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Note'
  /notes/{id}:
    get:
      operationId: getNote
      summary: Get a note
      description: Retrieve a specific note by its ID.
      tags:
      - Notes
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        '200':
          description: Note details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Note'
        '404':
          description: Note not found
components:
  schemas:
    Note:
      type: object
      properties:
        type:
          type: string
          enum:
          - Feature
        geometry:
          type: object
          properties:
            type:
              type: string
              enum:
              - Point
            coordinates:
              type: array
              items:
                type: number
              minItems: 2
              maxItems: 2
        properties:
          type: object
          properties:
            id:
              type: integer
              format: int64
            url:
              type: string
              format: uri
            status:
              type: string
              enum:
              - open
              - closed
            date_created:
              type: string
              format: date-time
            date_closed:
              type: string
              format: date-time
            comments:
              type: array
              items:
                type: object
                properties:
                  date:
                    type: string
                    format: date-time
                  user:
                    type: string
                  user_url:
                    type: string
                    format: uri
                  action:
                    type: string
                    enum:
                    - opened
                    - commented
                    - closed
                    - reopened
                  text:
                    type: string
                  html:
                    type: string
    NoteCollection:
      type: object
      properties:
        type:
          type: string
          enum:
          - FeatureCollection
        features:
          type: array
          items:
            $ref: '#/components/schemas/Note'
  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