Associated Press Content API

The Content API from Associated Press — 6 operation(s) for content.

OpenAPI Specification

associated-press-content-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Associated Press AP Media Account Content API
  description: AP's next generation content API.
  version: '2.2'
servers:
- url: //api.ap.org/media/v
security:
- apikey: []
  apikeyUrl: []
tags:
- name: Content
paths:
  /content/{item_id}:
    get:
      tags:
      - Content
      summary: Associated Press Single item metadata lookup
      description: 'Fetch the ''contentitem'' object for a single piece of content by its Item ID.

        '
      parameters:
      - name: item_id
        in: path
        description: 'The itemid of the desired piece of content

          '
        required: true
        schema:
          type: string
      - name: include
        in: query
        description: Comma separated list of fields to include from the response
        style: form
        explode: false
        schema:
          type: array
          items:
            type: string
      - name: exclude
        in: query
        description: Comma separated list of fields to exclude from the response
        style: form
        explode: false
        schema:
          type: array
          items:
            type: string
      - name: pricing
        in: query
        description: Whether to include pricing information with the results
        schema:
          type: boolean
      - name: in_my_plan
        in: query
        description: Specifying in_my_plan=true in the request returns only those associations of the content item that do not incur any additional cost to download.
        schema:
          type: boolean
      - name: format
        in: query
        description: The desired response format
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/contentresponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorresponse'
        '401':
          description: Invalid Auth
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorresponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorresponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorresponse'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorresponse'
      security:
      - apikey: []
      - apikeyUrl: []
  /content/search:
    get:
      tags:
      - Content
      summary: Associated Press Search for AP content
      description: 'Searches AP Content and returns `ContentItem` objects.

        Use the optional query param of **q** to filter the set of content

        '
      parameters:
      - name: q
        in: query
        description: Your query
        allowEmptyValue: true
        schema:
          type: string
      - name: include
        in: query
        description: Comma separated list of fields to include from the response
        style: form
        explode: false
        schema:
          type: array
          items:
            type: string
      - name: exclude
        in: query
        description: Comma separated list of fields to exclude from the response
        style: form
        explode: false
        schema:
          type: array
          items:
            type: string
      - name: sort
        in: query
        description: Your desired sorting criteria
        schema:
          type: string
          default: _score:desc
      - name: page
        in: query
        description: The desired page number. Page numbers begin at 1
        schema:
          type: string
      - name: page_size
        in: query
        description: Number of items to return per page
        schema:
          type: integer
      - name: pricing
        in: query
        description: Whether to include pricing information with the results
        schema:
          type: boolean
      - name: in_my_plan
        in: query
        description: Specifying in_my_plan=true in the request returns only those items that do not incur additional cost to download. Additionally, items returned include only those associations that do not incur any additional cost to download.
        schema:
          type: boolean
      - name: session_label
        in: query
        description: Attach an informational label to this session
        schema:
          maxLength: 48
          minLength: 1
          pattern: ^[a-zA-Z0-9_. -]*$
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/searchresponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorresponse'
        '401':
          description: Invalid Auth
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorresponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorresponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorresponse'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorresponse'
      security:
      - apikey: []
      - apikeyUrl: []
  /content/feed:
    get:
      tags:
      - Content
      summary: Associated Press Receive a feed of incoming AP content
      description: 'Receive a feed of AP Content as ''contentitem'' objects.

        Use the optional query param of **q** to filter the set of content

        '
      parameters:
      - name: q
        in: query
        description: Your query
        allowEmptyValue: true
        schema:
          type: string
      - name: include
        in: query
        description: Comma separated list of fields to include from the response
        style: form
        explode: false
        schema:
          type: array
          items:
            type: string
      - name: exclude
        in: query
        description: Comma separated list of fields to exclude from the response
        style: form
        explode: false
        schema:
          type: array
          items:
            type: string
      - name: page_size
        in: query
        description: Number of items to return per page
        schema:
          type: integer
      - name: pricing
        in: query
        description: Whether to include pricing information with the results
        schema:
          type: boolean
      - name: in_my_plan
        in: query
        description: Specifying in_my_plan=true in the request returns only those items that do not incur additional cost to download. Additionally, items returned include only those associations that do not incur any additional cost to download.
        schema:
          type: boolean
      - name: with_monitor
        in: query
        description: Apply the named Monitor to subsequent calls for this session
        schema:
          maxLength: 24
          minLength: 4
          pattern: ^[a-zA-Z0-9_.-]*$
          type: string
      - name: session_label
        in: query
        description: Attach an informational label to this session
        schema:
          maxLength: 48
          minLength: 1
          pattern: ^[a-zA-Z0-9_. -]*$
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/feedresponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorresponse'
        '401':
          description: Invalid Auth
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorresponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorresponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorresponse'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorresponse'
      security:
      - apikey: []
      - apikeyUrl: []
  /content/rss:
    get:
      tags:
      - Content
      summary: Associated Press Retrieve a list of available RSS XML feeds entitled to your plan.
      description: '(Successful responses always in XML)

        '
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rssresponse'
            text/xml:
              schema:
                $ref: '#/components/schemas/rssresponse'
        '304':
          description: Successful response, Not Modified
          content: {}
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorresponse'
            text/xml:
              schema:
                $ref: '#/components/schemas/errorresponse'
        '401':
          description: Invalid Auth
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorresponse'
            text/xml:
              schema:
                $ref: '#/components/schemas/errorresponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorresponse'
            text/xml:
              schema:
                $ref: '#/components/schemas/errorresponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorresponse'
            text/xml:
              schema:
                $ref: '#/components/schemas/errorresponse'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorresponse'
            text/xml:
              schema:
                $ref: '#/components/schemas/errorresponse'
      security:
      - apikey: []
      - apikeyUrl: []
  /content/rss/{rss_id}:
    get:
      tags:
      - Content
      summary: Associated Press Receive a RSS feed of latest AP content
      description: 'Receive a RSS feed of latest AP Content for a Product (RSS) Id.

        Use optional **include** and **exclude** to tailor the response.

        '
      parameters:
      - name: rss_id
        in: path
        description: "The product ID for the desired RSS feed (see /content/rss) \n"
        required: true
        schema:
          type: integer
      - name: include
        in: query
        description: Comma separated list of fields to include from the response
        style: form
        explode: false
        schema:
          type: array
          items:
            type: string
      - name: exclude
        in: query
        description: Comma separated list of fields to exclude from the response
        style: form
        explode: false
        schema:
          type: array
          items:
            type: string
      - name: page_size
        in: query
        description: Number of items to return per page
        schema:
          type: integer
      responses:
        '200':
          description: Successful response
          content: {}
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorresponse'
            text/xml:
              schema:
                $ref: '#/components/schemas/errorresponse'
        '401':
          description: Invalid Auth
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorresponse'
            text/xml:
              schema:
                $ref: '#/components/schemas/errorresponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorresponse'
            text/xml:
              schema:
                $ref: '#/components/schemas/errorresponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorresponse'
            text/xml:
              schema:
                $ref: '#/components/schemas/errorresponse'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorresponse'
            text/xml:
              schema:
                $ref: '#/components/schemas/errorresponse'
      security:
      - apikey: []
      - apikeyUrl: []
  /content/ondemand:
    get:
      tags:
      - Content
      summary: Associated Press Receive a feed of AP content items which have been sent to your organization's OnDemand queue.
      description: 'Receive a feed of ''contentitem'' objects which have been sent to your organization''s OnDemand queue.

        '
      parameters:
      - name: consumer_id
        in: query
        description: 'A user defined identifier for the consumer of this feed.

          Each unique consumer ID will receive every item in your organization''s OnDemand queue once.

          If not specified, the API key of the request will be used.'
        schema:
          type: string
      - name: queue
        in: query
        description: The ID of the desired queue.
        schema:
          type: string
      - name: include
        in: query
        description: Comma separated list of fields to include from the response
        style: form
        explode: false
        schema:
          type: array
          items:
            type: string
      - name: exclude
        in: query
        description: Comma separated list of fields to exclude from the response
        style: form
        explode: false
        schema:
          type: array
          items:
            type: string
      - name: page_size
        in: query
        description: Number of items to return per page
        schema:
          type: integer
      - name: pricing
        in: query
        description: Whether to include pricing information with the results
        schema:
          type: boolean
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/feedresponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorresponse'
        '401':
          description: Invalid Auth
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorresponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorresponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorresponse'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorresponse'
      security:
      - apikey: []
      - apikeyUrl: []
components:
  schemas:
    errorresponse:
      allOf:
      - $ref: '#/components/schemas/baseresponse'
      - type: object
        properties:
          error:
            type: object
            properties:
              status:
                type: integer
                description: The HTTP status code of this response
              code:
                type: integer
                description: The AP error code of this response
              message:
                type: string
                description: A human-readable description of the error
              timestamp:
                type: string
                description: the time at which the error was recorded
                format: date-time
              item:
                type: string
                description: In the event of a pricing change at download time, this property will contain a link to the item metadata with new pricing details and download links.
    contentresult:
      type: object
      properties:
        meta:
          type: object
          properties:
            score:
              type: number
              format: float
            products:
              type: array
              description: Your entitlements that matched this piece of content
              items:
                type: object
                properties:
                  id:
                    type: integer
                    description: The ID of the matched entitlement
                  name:
                    type: string
                    description: The name of the matched entitlement
            followed_topics:
              type: array
              description: Your followed topics that matched this piece of content
              items:
                type: object
                properties:
                  id:
                    type: integer
                    description: The ID of the matched followed topic
                  name:
                    type: string
                    description: The name of the matched followed topic
            pricing:
              required:
              - amount
              - currency
              - formatted
              - message
              - policy
              type: object
              properties:
                amount:
                  type: number
                  nullable: true
                currency:
                  type: string
                  nullable: true
                formatted:
                  type: string
                  nullable: true
                apusecode:
                  type: integer
                tier:
                  type: string
                message:
                  type: string
                policy:
                  required:
                  - policyid
                  - policytype
                  type: object
                  properties:
                    policytype:
                      type: string
                    policyid:
                      type: string
                    permissions:
                      type: array
                      items:
                        required:
                        - action
                        - assigner
                        - constraints
                        - duties
                        - target
                        type: object
                        properties:
                          target:
                            type: string
                          action:
                            type: string
                          assigner:
                            type: string
                          constraints:
                            type: array
                            items:
                              required:
                              - name
                              - operator
                              - rightoperand
                              type: object
                              properties:
                                operator:
                                  type: string
                                rightoperand:
                                  type: string
                                name:
                                  type: string
                          duties:
                            type: array
                            items:
                              required:
                              - action
                              type: object
                              properties:
                                action:
                                  type: string
                                constraints:
                                  type: array
                                  items:
                                    required:
                                    - name
                                    - operator
                                    - rightoperand
                                    - rightoperanddatatype
                                    - rightoperandunit
                                    type: object
                                    properties:
                                      operator:
                                        type: string
                                      rightoperand:
                                        type: string
                                      rightoperandunit:
                                        type: string
                                      name:
                                        type: string
                                      rightoperanddatatype:
                                        type: string
                    prohibitions:
                      type: array
                      items:
                        required:
                        - action
                        - assigner
                        - target
                        type: object
                        properties:
                          target:
                            type: string
                          action:
                            type: string
                          assigner:
                            type: string
        item:
          $ref: '#/components/schemas/contentitem'
    conditionStatus:
      type: object
      properties:
        enabled:
          type: boolean
          description: true if this particular condition is enabled for monitoring
        status:
          type: string
          description: 'A description of the status: ok|disabled|pending|initialized|alarm|recovered'
        status_detail:
          type: string
          description: Miscellaneous detail relating to status
        last_alerted:
          type: string
          description: When latest alert was issued
          format: date-time
      description: The status of an individual monitored condition
    rssresponse:
      type: object
      properties:
        rss:
          type: object
          properties:
            version:
              type: string
              xml:
                attribute: true
            channel:
              type: object
              properties:
                title:
                  type: string
                description:
                  type: string
                link:
                  type: string
    searchresponse:
      allOf:
      - $ref: '#/components/schemas/baseresponse'
      - type: object
        properties:
          data:
            type: object
            properties:
              query:
                type: string
                description: the query of the request
              updated:
                type: string
                description: the time at which the response was generated
                format: date-time
              page_size:
                type: integer
                description: the requested page size
              total_items:
                type: integer
                description: the total number of items matching this query
              current_page:
                type: integer
                description: the page index of this response
              current_item_count:
                type: integer
                description: the number of items in this response
              next_page:
                type: string
                description: a link to the next page of results
              previous_page:
                type: string
                description: a link to the previous page of results
              page_template:
                type: string
                description: a paging template string
              feed_href:
                type: string
                description: a link to the feed endpoint for the current query
              items:
                type: array
                description: The current page of results that match the query
                items:
                  $ref: '#/components/schemas/contentresult'
    feedresponse:
      allOf:
      - $ref: '#/components/schemas/monitoredBaseresponse'
      - type: object
        properties:
          data:
            type: object
            properties:
              query:
                type: string
                description: the query of the request
              updated:
                type: string
                description: the time at which the response was generated
                format: date-time
              total_items:
                type: integer
                description: the total number of search results
              current_page:
                type: integer
                description: the current page index
              page_size:
                type: integer
                description: the requested page size
              current_item_count:
                type: integer
                description: the number of items in this response
              next_page:
                type: string
                description: a link to the next page of results
              previous_page:
                type: string
                description: a link to the previous page of results
              page_template:
                type: string
                description: a template to use with client-side paging
              items:
                type: array
                items:
                  $ref: '#/components/schemas/contentresult'
    sessionMonitorResponse:
      allOf:
      - type: object
        properties:
          monitor:
            type: object
            properties:
              name:
                type: string
                description: Name of assigned Monitor
              label:
                type: string
                description: Optional session_label
              enabled:
                type: boolean
                description: true if the overall session is elligible for monitoring
              last_checked:
                type: string
                description: When an eligible session monitor was last checked
                format: date-time
              enable_session_monitor:
                type: string
                description: Call this link to enable monitoring for this session
              disable_session_monitor:
                type: string
                description: Call this link to disable monitoring for this session
              conditionStatus:
                type: object
                properties:
                  idleFeed:
                    $ref: '#/components/schemas/conditionStatus'
                  quality:
                    $ref: '#/components/schemas/conditionStatus'
              feed_count:
                type: integer
                description: count of feed requests made in this session
            description: High level monitor status for monitored sessions
    monitoredBaseresponse:
      allOf:
      - $ref: '#/components/schemas/baseresponse'
      - $ref: '#/components/schemas/sessionMonitorResponse'
    baseresponse:
      required:
      - api_version
      - id
      - method
      - params
      type: object
      properties:
        api_version:
          type: string
          description: The version of the API that generated the response
        api_mode:
          type: string
          description: The API environment mode that generated the response
        api_build:
          type: string
          description: The specific build version of the API
        id:
          type: string
          description: The ID of this session or response
        method:
          type: string
          description: The method that generated the response
        org_name:
          type: string
          description: The organization associated with the request's API key
        session_label:
          type: string
          description: Optional customer label supplied at session creation
        params:
          type: object
          additionalProperties: true
          description: The parameters issued with the request
      discriminator:
        propertyName: method
    contentresponse:
      allOf:
      - $ref: '#/components/schemas/baseresponse'
      - type: object
        properties:
          data:
            $ref: '#/components/schemas/contentresult'
    contentitem:
      type: object
      properties:
        uri:
          type: string
          description: The identifier for this content item expressed as a URI.
        altids:
          required:
          - itemid
          type: object
          properties:
            itemid:
              type: string
              description: A unique content item ID. For items with multiple versions, remains the same for the initial version and each subsequent revision. For example, if a news story is written and rewritten several times as new information is uncovered, this ID value remains the same for each rewrite because it points to the chain of revised stories, and not an individual version.
            etag:
              type: string
              description: ' A short digest (also known as checksum or hash) of the item''s metadata. Useful for deduplication and conditional requests.'
            friendlykey:
              type: string
              description: A human-readable ID of a content item. For video, this is the AP Archive story number.
            videoid:
              type: string
            transref:
              type: string
              description: Transmission Reference Number; the alphanumeric identifier (or file name) associated with a story or photo.
            graphicsbankid:
              type: string
            'referenceid ':
              type: string
          description: Alternative IDs of a content item
        foreignkeys:
          type: array
          items:
            type: object
        version:
          type: integer
          description: "The content item version number: 0 for the initial version, 1 for the first version, 2 for the second version and so on. The higher the number, the more recent the content item's version. \n - For text stories, this is the version of the story revision. \n - For other media types (for example, photos, graphics and video), this is the version of the item metadata; for example, a photo caption. Typically, significant changes to the binary asset (such as a photo) are published as a new content item."
        type:
          type: string
          description: 'The generic news type of this content item: text, picture, graphic, audio or video.'
          enum:
          - text
          - picture
          - graphic
          - audio
          - video
        profile:
          type: string
          description: The type of information contained in the news item (also known as 'ItemContentType

# --- truncated at 32 KB (67 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/associated-press/refs/heads/main/openapi/associated-press-content-api-openapi.yml