US Department of Commerce Images API

Images published on Commerce.gov

OpenAPI Specification

us-department-of-commerce-images-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Commerce.gov Blogs Images 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: Images
  description: Images published on Commerce.gov
paths:
  /api/image:
    get:
      operationId: listImages
      summary: List Images
      description: Returns a paginated list of images published on Commerce.gov.
      tags:
      - Images
      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
      responses:
        '200':
          description: A list of images
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Image'
                  meta:
                    $ref: '#/components/schemas/PaginationMeta'
        '400':
          description: Bad request
components:
  schemas:
    Image:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the image
        title:
          type: string
          description: Title or alt text of the image
        url:
          type: string
          description: URL to the image file
        created:
          type: string
          format: date-time
          description: Date and time the image was uploaded
        changed:
          type: string
          format: date-time
          description: Date and time the image was last modified
    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