Gotham Greens Media API

Public, unauthenticated read access to the media library behind gothamgreens.com — product photography, farm imagery and recipe images with their generated size variants.

OpenAPI Specification

gotham-greens-media-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Gotham Greens Media API
  version: wp/v2
  summary: Public read surface of the gothamgreens.com media library.
  description: >-
    The `attachment` (media) type behind gothamgreens.com — product photography, greenhouse and
    farm imagery, and Journal recipe images — exposed anonymously through the WordPress core REST
    API, including each asset's generated size variants and source URL. Derived from the live
    route index and verified with anonymous probes returning HTTP 200. Upload and edit operations
    on these routes require authentication and are not documented here.
  contact:
    name: Gotham Greens
    url: https://www.gothamgreens.com/contact/
  license:
    name: Site content — all rights reserved, see Terms of Use
    url: https://www.gothamgreens.com/terms-of-use/
  x-apis-io-provenance:
    method: derived
    source: https://www.gothamgreens.com/wp-json/
    derived_on: '2026-08-01'
    note: >-
      Routes enumerated from the live wp-json discovery document (406 routes across 17
      namespaces); each operation below was probed anonymously and returned HTTP 200. Schemas
      reflect the fields observed in live responses on 2026-08-01. No fabricated operations.
servers:
- url: https://www.gothamgreens.com/wp-json
  description: Production
tags:
- name: Media
  description: Media library attachments and their generated size variants.
paths:
  /wp/v2/media:
    get:
      tags:
      - Media
      operationId: listMedia
      summary: List media items
      description: Returns a paginated collection of media library attachments.
      parameters:
      - $ref: '#/components/parameters/page'
      - $ref: '#/components/parameters/perPage'
      - $ref: '#/components/parameters/search'
      - $ref: '#/components/parameters/order'
      - $ref: '#/components/parameters/orderby'
      - $ref: '#/components/parameters/context'
      - name: media_type
        in: query
        description: Limit results to attachments of a specific media type.
        schema:
          type: string
          enum: [image, video, text, application, audio]
      - name: mime_type
        in: query
        description: Limit results to attachments of a specific MIME type.
        schema:
          type: string
      - name: parent
        in: query
        description: Limit results to attachments attached to the given post IDs.
        schema:
          type: array
          items:
            type: integer
      responses:
        '200':
          description: A page of media items.
          headers:
            X-WP-Total:
              $ref: '#/components/headers/XWPTotal'
            X-WP-TotalPages:
              $ref: '#/components/headers/XWPTotalPages'
            Link:
              $ref: '#/components/headers/LinkPagination'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MediaItem'
        '400':
          $ref: '#/components/responses/InvalidParam'
  /wp/v2/media/{id}:
    get:
      tags:
      - Media
      operationId: getMediaItem
      summary: Get a media item
      description: Returns a single media library attachment by its numeric ID.
      parameters:
      - $ref: '#/components/parameters/id'
      - $ref: '#/components/parameters/context'
      responses:
        '200':
          description: The requested media item.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MediaItem'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    id:
      name: id
      in: path
      required: true
      description: Unique numeric identifier for the object.
      schema:
        type: integer
    page:
      name: page
      in: query
      description: Current page of the collection. Defaults to 1.
      schema:
        type: integer
        minimum: 1
        default: 1
    perPage:
      name: per_page
      in: query
      description: >-
        Maximum number of items to be returned in the result set. Verified live: values outside
        1-100 return HTTP 400 `rest_invalid_param`.
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 10
    search:
      name: search
      in: query
      description: Limit results to those matching a string.
      schema:
        type: string
    order:
      name: order
      in: query
      description: Order sort attribute ascending or descending.
      schema:
        type: string
        enum: [asc, desc]
    orderby:
      name: orderby
      in: query
      description: Sort collection by object attribute.
      schema:
        type: string
    context:
      name: context
      in: query
      description: >-
        Scope under which the request is made; determines fields present in the response. Only
        `view` and `embed` are available anonymously.
      schema:
        type: string
        enum: [view, embed]
        default: view
  headers:
    XWPTotal:
      description: Total number of items in the collection.
      schema:
        type: integer
    XWPTotalPages:
      description: Total number of pages in the collection at the current per_page.
      schema:
        type: integer
    LinkPagination:
      description: RFC 8288 Link header carrying `next` and `prev` pagination relations.
      schema:
        type: string
  responses:
    NotFound:
      description: The requested object does not exist.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: rest_no_route
            message: No route was found matching the URL and request method.
            data:
              status: 404
    InvalidParam:
      description: One or more query parameters failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: rest_invalid_param
            message: 'Invalid parameter(s): per_page'
            data:
              status: 400
              params:
                per_page: per_page must be between 1 (inclusive) and 100 (inclusive)
    Unauthorized:
      description: >-
        The route exists but is not readable anonymously. Verified live on the users, settings,
        themes, plugins, menus, block-types and revisions routes.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: rest_forbidden
            message: Sorry, you are not allowed to do that.
            data:
              status: 401
  schemas:
    RenderedText:
      type: object
      description: WordPress rendered-text object.
      properties:
        rendered:
          type: string
      required: [rendered]
    Error:
      type: object
      description: >-
        The WordPress REST error envelope, verified live. Note this is NOT RFC 9457
        application/problem+json — it is served as application/json with a WordPress-specific shape.
      properties:
        code:
          type: string
        message:
          type: string
        data:
          type: object
          properties:
            status:
              type: integer
            params:
              type: object
              additionalProperties:
                type: string
            details:
              type: object
              additionalProperties: true
          required: [status]
      required: [code, message, data]
    MediaItem:
      type: object
      description: A media library attachment as returned anonymously in `view` context.
      properties:
        id:
          type: integer
        date:
          type: string
          format: date-time
        date_gmt:
          type: string
          format: date-time
        guid:
          $ref: '#/components/schemas/RenderedText'
        modified:
          type: string
          format: date-time
        modified_gmt:
          type: string
          format: date-time
        slug:
          type: string
        status:
          type: string
        type:
          type: string
          const: attachment
        link:
          type: string
          format: uri
        title:
          $ref: '#/components/schemas/RenderedText'
        author:
          type: integer
        comment_status:
          type: string
        ping_status:
          type: string
        template:
          type: string
        meta:
          type: object
          additionalProperties: true
        class_list:
          type: array
          items:
            type: string
        acf:
          oneOf:
          - type: object
            additionalProperties: true
          - type: array
        description:
          $ref: '#/components/schemas/RenderedText'
        caption:
          $ref: '#/components/schemas/RenderedText'
        alt_text:
          type: string
        media_type:
          type: string
        mime_type:
          type: string
        filename:
          type: string
        filesize:
          type: integer
        media_details:
          type: object
          additionalProperties: true
          description: Width, height, file path, image_meta and the generated `sizes` map.
        post:
          type: [integer, 'null']
          description: ID of the post this attachment is attached to, if any.
        source_url:
          type: string
          format: uri
          description: Direct URL to the original uploaded file.
        featured_media:
          type: integer
        _links:
          type: object
          additionalProperties: true
      required: [id, type, source_url, media_type, mime_type]