Stack Exchange Filters API

Custom response filter creation and inspection.

OpenAPI Specification

stackexchange-filters-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Stack Exchange Access Tokens Filters API
  description: 'Public, read-mostly HTTP/JSON API spanning all 180+ Stack Exchange sites

    (Stack Overflow, Server Fault, Super User, Ask Ubuntu, Stats, Math Overflow, ...).


    All method families live under a single base URL with a uniform wrapper

    (`items`, `has_more`, `page`, `quota_max`, `quota_remaining`, `backoff`).

    Read access is unauthenticated. Write methods require OAuth 2.0 with the

    appropriate scopes (`write_access`, `private_info`, `no_expiry`).


    Most paths take a required `site` query parameter naming the target Q&A

    community (`stackoverflow`, `serverfault`, `superuser`, ...). Use `/sites`

    to enumerate the network.

    '
  version: '2.3'
  termsOfService: https://stackoverflow.com/legal/api-terms-of-use
  contact:
    name: Stack Exchange API
    url: https://api.stackexchange.com/
  license:
    name: Creative Commons BY-SA 4.0 (content) / API Terms of Use
    url: https://stackoverflow.com/legal/api-terms-of-use
  x-generated-from: documentation
  x-last-validated: '2026-05-29'
servers:
- url: https://api.stackexchange.com/2.3
  description: Stack Exchange API v2.3 production endpoint
security:
- apiKey: []
tags:
- name: Filters
  description: Custom response filter creation and inspection.
paths:
  /filters/create:
    get:
      tags:
      - Filters
      operationId: createFilter
      summary: Stack Exchange Create Filter
      description: Create a custom response filter.
      parameters:
      - name: include
        in: query
        schema:
          type: string
          example: question.body;question.body_markdown
      - name: exclude
        in: query
        schema:
          type: string
      - name: base
        in: query
        schema:
          type: string
          enum:
          - default
          - none
          - withbody
          - total
          default: default
      - name: unsafe
        in: query
        schema:
          type: boolean
          default: false
      - $ref: '#/components/parameters/Key'
      responses:
        '200':
          description: A single-element list with the new filter.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FiltersResponse'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /filters/{filters}:
    get:
      tags:
      - Filters
      operationId: getFiltersByIds
      summary: Stack Exchange Get Filters by Ids
      description: Inspect existing filters.
      parameters:
      - name: filters
        in: path
        required: true
        description: Up to 20 semicolon-delimited filter ids.
        schema:
          type: string
      - $ref: '#/components/parameters/Key'
      responses:
        '200':
          description: A page of filters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FiltersResponse'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    FiltersResponse:
      allOf:
      - $ref: '#/components/schemas/Wrapper'
      - type: object
        properties:
          items:
            type: array
            items:
              $ref: '#/components/schemas/Filter'
    Wrapper:
      type: object
      description: Common envelope returned by every Stack Exchange API method.
      properties:
        backoff:
          type: integer
          description: Seconds the client MUST wait before re-querying this same method. Returned when the API has identified the consumer as expensive.
          example: 0
        error_id:
          type: integer
          description: Numeric error code when the response is an error.
        error_message:
          type: string
          description: Human-readable error message.
        error_name:
          type: string
          description: Stable error name (e.g. `throttle_violation`).
        has_more:
          type: boolean
          description: True when more pages exist past the returned `page`.
          example: true
        page:
          type: integer
          description: Page number echoed from the request.
          example: 1
        page_size:
          type: integer
          description: Page size echoed from the request.
          example: 30
        quota_max:
          type: integer
          description: Daily quota for the IP/key combination.
          example: 10000
        quota_remaining:
          type: integer
          description: Quota left after this request.
          example: 9999
        total:
          type: integer
          description: Total count when the consumer requested it via filter.
        type:
          type: string
          description: Type name of the items returned.
      required:
      - has_more
      - quota_max
      - quota_remaining
    Filter:
      type: object
      properties:
        filter:
          type: string
        filter_type:
          type: string
          enum:
          - safe
          - unsafe
          - invalid
        included_fields:
          type: array
          items:
            type: string
  parameters:
    Key:
      name: key
      in: query
      required: false
      description: App key from stackapps.com. Raises the daily quota to 10,000/IP.
      schema:
        type: string
        example: example_app_key_abcdef
  securitySchemes:
    oauth2:
      type: oauth2
      description: 'OAuth 2.0 explicit or implicit flow. Apps register on stackapps.com.

        Read methods do not require auth; write methods require `write_access`.

        `private_info` is needed for /me/notifications, /me/inbox, and similar

        private surfaces. `no_expiry` issues tokens that never expire.

        '
      flows:
        authorizationCode:
          authorizationUrl: https://stackoverflow.com/oauth
          tokenUrl: https://stackoverflow.com/oauth/access_token
          scopes:
            read_inbox: Access the authenticated user's inbox.
            no_expiry: Issue a token that never expires.
            write_access: Vote, post, comment, flag, accept on the user's behalf.
            private_info: Access endpoints that return personal information.
    apiKey:
      type: apiKey
      in: query
      name: key
      description: 'Optional app key. Sending a key raises the daily quota from 300 to 10,000

        requests per IP and is the recommended default for any non-trivial client.

        '