Stack Overflow Answers API

Operations for managing answers to questions in a Teams workspace.

Operations 6

GET /teams/{team}/questions/{id}/answers Get Answers for a Team Question #
POST /teams/{team}/questions/{id}/answers Create an Answer for a Team Question #
GET /questions/{ids}/answers Get Answers for Questions #
GET /answers Get All Answers #
GET /answers/{ids} Get Answers by IDs #
GET /users/{ids}/answers Get Answers by User #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/stack-overflow-answers-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

stack-overflow-answers-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Stack Overflow Answers API
  version: '1.0'
  description: 'Operations tagged Answers across 2 of this provider''s published API definitions: stack-overflow-for-teams-openapi.yml, stack-overflow-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.stackoverflowteams.com/v3
  description: Stack Overflow for Teams API v3
- url: https://api.stackexchange.com/2.3
  description: Stack Exchange API v2.3
tags:
- name: Answers
  description: Operations for managing answers to questions in a Teams workspace.
paths:
  /teams/{team}/questions/{id}/answers:
    get:
      operationId: getTeamAnswers
      summary: Get Answers for a Team Question
      description: Returns all answers to a specific question in a Stack Overflow for Teams workspace.
      tags:
      - Answers
      parameters:
      - $ref: '#/components/parameters/team'
      - $ref: '#/components/parameters/id'
      - $ref: '#/components/parameters/filter'
      responses:
        '200':
          description: Answers for the specified question
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnswersResponse'
      security:
      - bearerAuth: []
    post:
      operationId: createTeamAnswer
      summary: Create an Answer for a Team Question
      description: Creates a new answer to a question in a Stack Overflow for Teams workspace. Requires write access.
      tags:
      - Answers
      parameters:
      - $ref: '#/components/parameters/team'
      - $ref: '#/components/parameters/id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAnswerRequest'
      responses:
        '201':
          description: Answer created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Answer'
        '403':
          $ref: '#/components/responses/Forbidden'
      security:
      - bearerAuth: []
    servers:
    - url: https://api.stackoverflowteams.com/v3
      description: Stack Overflow for Teams API v3
  /questions/{ids}/answers:
    get:
      operationId: getAnswersForQuestion
      summary: Get Answers for Questions
      description: Returns the answers for the questions identified by a semicolon- delimited list of question IDs.
      tags:
      - Answers
      parameters:
      - name: ids
        in: path
        required: true
        schema:
          type: string
        description: Semicolon-delimited list of question IDs
      - $ref: '#/components/parameters/site'
      - $ref: '#/components/parameters/page'
      - $ref: '#/components/parameters/pagesize'
      - $ref: '#/components/parameters/order'
      - $ref: '#/components/parameters/sort'
      - $ref: '#/components/parameters/filter'
      responses:
        '200':
          description: Answers for the specified questions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnswersResponse_2'
      security:
      - oauth2: []
      - {}
    servers:
    - url: https://api.stackexchange.com/2.3
      description: Stack Exchange API v2.3
  /answers:
    get:
      operationId: getAnswers
      summary: Get All Answers
      description: Returns all answers on Stack Overflow sorted by creation date, activity, or vote score.
      tags:
      - Answers
      parameters:
      - $ref: '#/components/parameters/site'
      - $ref: '#/components/parameters/page'
      - $ref: '#/components/parameters/pagesize'
      - $ref: '#/components/parameters/fromdate'
      - $ref: '#/components/parameters/todate'
      - $ref: '#/components/parameters/order'
      - $ref: '#/components/parameters/sort'
      - $ref: '#/components/parameters/filter'
      responses:
        '200':
          description: A list of answers
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnswersResponse_2'
      security:
      - oauth2: []
      - {}
    servers:
    - url: https://api.stackexchange.com/2.3
      description: Stack Exchange API v2.3
  /answers/{ids}:
    get:
      operationId: getAnswersByIds
      summary: Get Answers by IDs
      description: Returns the answers identified by a semicolon-delimited list of answer IDs.
      tags:
      - Answers
      parameters:
      - name: ids
        in: path
        required: true
        schema:
          type: string
        description: Semicolon-delimited list of answer IDs
      - $ref: '#/components/parameters/site'
      - $ref: '#/components/parameters/filter'
      responses:
        '200':
          description: Answers matching the provided IDs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnswersResponse_2'
      security:
      - oauth2: []
      - {}
    servers:
    - url: https://api.stackexchange.com/2.3
      description: Stack Exchange API v2.3
  /users/{ids}/answers:
    get:
      operationId: getAnswersByUser
      summary: Get Answers by User
      description: Returns answers posted by users identified by a semicolon-delimited list of user IDs.
      tags:
      - Answers
      parameters:
      - name: ids
        in: path
        required: true
        schema:
          type: string
        description: Semicolon-delimited list of user IDs
      - $ref: '#/components/parameters/site'
      - $ref: '#/components/parameters/page'
      - $ref: '#/components/parameters/pagesize'
      - $ref: '#/components/parameters/order'
      - $ref: '#/components/parameters/sort'
      - $ref: '#/components/parameters/filter'
      responses:
        '200':
          description: Answers posted by the specified users
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnswersResponse_2'
      security:
      - oauth2: []
      - {}
    servers:
    - url: https://api.stackexchange.com/2.3
      description: Stack Exchange API v2.3
components:
  schemas:
    Answer:
      type: object
      properties:
        id:
          type: integer
          description: Unique identifier of the answer
        question_id:
          type: integer
          description: ID of the question this answer belongs to
        body:
          type: string
          description: The HTML body of the answer
        score:
          type: integer
          description: Net vote score
        is_accepted:
          type: boolean
          description: Whether this is the accepted answer
        creation_date:
          type: string
          format: date-time
        owner:
          $ref: '#/components/schemas/UserRef'
    ErrorResponse:
      type: object
      properties:
        error_id:
          type: integer
        error_message:
          type: string
        error_name:
          type: string
    UserRef:
      type: object
      properties:
        id:
          type: integer
        display_name:
          type: string
        profile_image:
          type: string
          format: uri
    CreateAnswerRequest:
      type: object
      required:
      - body
      properties:
        body:
          type: string
          description: Answer body in Markdown
    AnswersResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/Answer'
        has_more:
          type: boolean
        total:
          type: integer
    Answer_2:
      type: object
      properties:
        answer_id:
          type: integer
        question_id:
          type: integer
        body:
          type: string
        score:
          type: integer
        is_accepted:
          type: boolean
        creation_date:
          type: integer
        last_activity_date:
          type: integer
        owner:
          $ref: '#/components/schemas/ShallowUser'
        link:
          type: string
          format: uri
    ShallowUser:
      type: object
      properties:
        user_id:
          type: integer
        display_name:
          type: string
        reputation:
          type: integer
        user_type:
          type: string
          enum:
          - unregistered
          - registered
          - moderator
        profile_image:
          type: string
          format: uri
        link:
          type: string
          format: uri
    Wrapper:
      type: object
      properties:
        items:
          type: array
          items:
            type: object
        has_more:
          type: boolean
        quota_max:
          type: integer
        quota_remaining:
          type: integer
        backoff:
          type: integer
        total:
          type: integer
    AnswersResponse_2:
      allOf:
      - $ref: '#/components/schemas/Wrapper'
      - type: object
        properties:
          items:
            type: array
            items:
              $ref: '#/components/schemas/Answer_2'
  parameters:
    filter:
      name: filter
      in: query
      schema:
        type: string
      description: Filter to control which fields are returned
    id:
      name: id
      in: path
      required: true
      schema:
        type: integer
      description: The unique identifier of the resource
    team:
      name: team
      in: path
      required: true
      schema:
        type: string
      description: The slug of the Stack Overflow for Teams workspace. If your team lives at stackoverflowteams.com/c/my-team, the slug is my-team.
      example: my-team
    order:
      name: order
      in: query
      schema:
        type: string
        enum:
        - asc
        - desc
        default: desc
      description: Sort order
    pagesize:
      name: pagesize
      in: query
      schema:
        type: integer
        minimum: 0
        maximum: 100
        default: 30
      description: Number of results per page (max 100)
    page:
      name: page
      in: query
      schema:
        type: integer
        minimum: 1
        default: 1
      description: Page number (1-indexed)
    todate:
      name: todate
      in: query
      schema:
        type: integer
      description: Unix timestamp for maximum creation date
    site:
      name: site
      in: query
      required: true
      schema:
        type: string
        default: stackoverflow
      description: Stack Exchange site identifier (use stackoverflow for Stack Overflow)
    sort:
      name: sort
      in: query
      schema:
        type: string
      description: Field to sort results by
    fromdate:
      name: fromdate
      in: query
      schema:
        type: integer
      description: Unix timestamp for minimum creation date
  responses:
    Forbidden:
      description: Insufficient permissions (requires write access or Business tier)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Personal Access Token (PAT) authentication. Pass your PAT as a Bearer token in the Authorization header. Generate tokens from your Stack Overflow for Teams account settings.
    oauth2:
      type: oauth2
      description: OAuth 2.0 authentication. Register an application at http://stackapps.com/apps/oauth to obtain credentials.
      flows:
        authorizationCode:
          authorizationUrl: https://stackoverflow.com/oauth
          tokenUrl: https://stackoverflow.com/oauth/access_token/json
          scopes:
            no_expiry: Issues an access token that does not expire
            write_access: Allows write access to a user's data
            private_info: Access a user's private information
x-refined-from:
- stack-overflow-for-teams-openapi.yml
- stack-overflow-openapi.yml