US Department of Commerce News API

News articles published on Commerce.gov

OpenAPI Specification

us-department-of-commerce-news-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Commerce.gov Blogs News API
  description: The Commerce.gov API provides programmatic access to news and blog content published on the Commerce.gov website. Version 2.0 introduced a complete rewrite to reflect the redesign of the Commerce.gov D8 website, supporting news, blogs, and image endpoints. Response fields are preserved for backward compatibility.
  version: '2.0'
  contact:
    url: https://www.commerce.gov/data-and-reports/developer-resources/commercegov-api
  license:
    name: US Government Work
    url: https://www.usa.gov/government-works
servers:
- url: https://www.commerce.gov
  description: Commerce.gov Production Server
tags:
- name: News
  description: News articles published on Commerce.gov
paths:
  /api/news:
    get:
      operationId: listNews
      summary: List News Articles
      description: Returns a paginated list of news articles published on Commerce.gov.
      tags:
      - News
      parameters:
      - name: page
        in: query
        description: Page number for pagination
        required: false
        schema:
          type: integer
          minimum: 0
          default: 0
      - name: items_per_page
        in: query
        description: Number of items to return per page
        required: false
        schema:
          type: integer
          minimum: 1
          maximum: 50
          default: 10
      - name: sort_by
        in: query
        description: Field to sort results by
        required: false
        schema:
          type: string
          enum:
          - created
          - changed
      - name: sort_order
        in: query
        description: Sort direction
        required: false
        schema:
          type: string
          enum:
          - ASC
          - DESC
          default: DESC
      responses:
        '200':
          description: A list of news articles
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/NewsArticle'
                  meta:
                    $ref: '#/components/schemas/PaginationMeta'
        '400':
          description: Bad request
  /api/news/{id}:
    get:
      operationId: getNewsArticle
      summary: Get News Article
      description: Returns a single news article by ID.
      tags:
      - News
      parameters:
      - name: id
        in: path
        description: Unique identifier of the news article
        required: true
        schema:
          type: string
      responses:
        '200':
          description: A news article
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NewsArticle'
        '404':
          description: Article not found
components:
  schemas:
    NewsArticle:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the news article
        title:
          type: string
          description: Title of the news article
        body:
          type: string
          description: Full HTML body content of the article
        summary:
          type: string
          description: Short summary of the article
        created:
          type: string
          format: date-time
          description: Date and time the article was created
        changed:
          type: string
          format: date-time
          description: Date and time the article was last modified
        url:
          type: string
          description: Relative URL path to the article on Commerce.gov
        field_image:
          type: string
          description: URL of the featured image
        tags:
          type: array
          items:
            type: string
          description: Topic tags associated with the article
    PaginationMeta:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items available
        page:
          type: integer
          description: Current page number
        items_per_page:
          type: integer
          description: Number of items per page