National Park Service Data API

Search and retrieve parks, alerts, campgrounds, visitor centers, events, and articles for U.S. National Park Service units.

OpenAPI Specification

nps-data-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: National Park Service (NPS) Data API
  description: >-
    The National Park Service Data API provides programmatic access to
    information about U.S. national parks - park overviews, alerts, events,
    visitor centers, campgrounds, things to do, news releases, articles,
    people, places, and more. The API is REST-based and returns JSON.
  version: '1'
  contact:
    name: NPS Developer Resources
    url: https://www.nps.gov/subjects/developer/
  license:
    name: Public Domain
    url: https://creativecommons.org/publicdomain/mark/1.0/
externalDocs:
  description: NPS API documentation
  url: https://www.nps.gov/subjects/developer/api-documentation.htm
servers:
  - url: https://developer.nps.gov/api/v1
    description: Production
tags:
  - name: Parks
    description: National parks
  - name: Alerts
    description: Park alerts and emergencies
  - name: Campgrounds
    description: Campground listings
  - name: VisitorCenters
    description: Visitor centers
  - name: Events
    description: Park events
  - name: Articles
    description: News articles and releases
security:
  - ApiKeyAuth: []
paths:
  /parks:
    get:
      tags: [Parks]
      summary: List or search national parks
      operationId: listParks
      parameters:
        - $ref: '#/components/parameters/parkCode'
        - $ref: '#/components/parameters/stateCode'
        - $ref: '#/components/parameters/q'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/start'
      responses:
        '200':
          description: Parks
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ParkResponse'
  /alerts:
    get:
      tags: [Alerts]
      summary: List park alerts
      operationId: listAlerts
      parameters:
        - $ref: '#/components/parameters/parkCode'
        - $ref: '#/components/parameters/stateCode'
        - $ref: '#/components/parameters/q'
      responses:
        '200':
          description: Alerts
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertResponse'
  /campgrounds:
    get:
      tags: [Campgrounds]
      summary: List campgrounds
      operationId: listCampgrounds
      parameters:
        - $ref: '#/components/parameters/parkCode'
        - $ref: '#/components/parameters/stateCode'
        - $ref: '#/components/parameters/q'
      responses:
        '200':
          description: Campgrounds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampgroundResponse'
  /visitorcenters:
    get:
      tags: [VisitorCenters]
      summary: List visitor centers
      operationId: listVisitorCenters
      parameters:
        - $ref: '#/components/parameters/parkCode'
      responses:
        '200':
          description: Visitor centers
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericResponse'
  /events:
    get:
      tags: [Events]
      summary: List park events
      operationId: listEvents
      parameters:
        - $ref: '#/components/parameters/parkCode'
        - $ref: '#/components/parameters/stateCode'
        - name: dateStart
          in: query
          schema:
            type: string
            format: date
        - name: dateEnd
          in: query
          schema:
            type: string
            format: date
      responses:
        '200':
          description: Events
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericResponse'
  /articles:
    get:
      tags: [Articles]
      summary: List articles
      operationId: listArticles
      parameters:
        - $ref: '#/components/parameters/parkCode'
        - $ref: '#/components/parameters/q'
        - $ref: '#/components/parameters/limit'
      responses:
        '200':
          description: Articles
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericResponse'
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: query
      name: api_key
  parameters:
    parkCode:
      name: parkCode
      in: query
      schema:
        type: string
      description: Comma-separated four-letter park codes (e.g. yose,grca)
    stateCode:
      name: stateCode
      in: query
      schema:
        type: string
        pattern: ^[A-Z]{2}(,[A-Z]{2})*$
    q:
      name: q
      in: query
      schema:
        type: string
      description: Free-text search
    limit:
      name: limit
      in: query
      schema:
        type: integer
        default: 50
        maximum: 50
    start:
      name: start
      in: query
      schema:
        type: integer
        default: 0
  schemas:
    ParkResponse:
      type: object
      properties:
        total:
          type: string
        limit:
          type: string
        start:
          type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/Park'
    Park:
      type: object
      properties:
        id:
          type: string
        url:
          type: string
        fullName:
          type: string
        parkCode:
          type: string
        description:
          type: string
        latitude:
          type: string
        longitude:
          type: string
        latLong:
          type: string
        states:
          type: string
        designation:
          type: string
        directionsInfo:
          type: string
        directionsUrl:
          type: string
        weatherInfo:
          type: string
        addresses:
          type: array
          items:
            type: object
        contacts:
          type: object
        operatingHours:
          type: array
          items:
            type: object
        entranceFees:
          type: array
          items:
            type: object
        activities:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              name:
                type: string
        topics:
          type: array
          items:
            type: object
        images:
          type: array
          items:
            type: object
    AlertResponse:
      type: object
      properties:
        total:
          type: string
        data:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              url:
                type: string
              title:
                type: string
              parkCode:
                type: string
              description:
                type: string
              category:
                type: string
                enum: [Caution, Danger, Information, Park Closure]
              lastIndexedDate:
                type: string
    CampgroundResponse:
      type: object
      properties:
        total:
          type: string
        data:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              url:
                type: string
              name:
                type: string
              parkCode:
                type: string
              description:
                type: string
              latitude:
                type: string
              longitude:
                type: string
              reservationInfo:
                type: string
              regulationsurl:
                type: string
              fees:
                type: array
                items:
                  type: object
              campsites:
                type: object
              amenities:
                type: object
    GenericResponse:
      type: object
      properties:
        total:
          type: string
        limit:
          type: string
        start:
          type: string
        data:
          type: array
          items:
            type: object
            additionalProperties: true