> ## Documentation Index
> Fetch the complete documentation index at: https://docs.polymarketdata.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Get market details

> Get detailed information about a specific market by ID or slug.

Returns full market information, including tokens, description, and resolution status.



## OpenAPI

````yaml https://api.polymarketdata.co/openapi.json get /v1/markets/{id_or_slug}
openapi: 3.1.0
info:
  title: PolymarketData API
  description: >-
    Historical Polymarket market data with plan-based access controls
    (resolution, lookback window, and RPM).


    Use this API to discover markets, then query historical metrics, prices, and
    order books.


    ## Authentication


    All `/v1` endpoints require an API key.


    1. Sign in to the PolymarketData dashboard.
    [https://app.polymarketdata.co/](https://app.polymarketdata.co/dashboard)

    2. Create an API key.

    3. Send the key in the `X-API-Key` header on every request.


    Header format:


    `X-API-Key: pk_live_your_key_here`


    ## Key Concepts


    Polymarket data is organized in a hierarchy:


    - **Series**: Broad themes or recurring categories (for example, `US
    Politics` or `NBA`).

    - **Events**: Specific real-world happenings within a series (for example,
    `Presidential Debate`).

    - **Markets**: Tradable prediction questions inside an event (for example,
    `Will candidate X win?`).

    - **Tokens**: Outcome contracts within a market (for example, `Yes` and
    `No`).


    Mental model: `Series -> Events -> Markets -> Tokens`.


    ## Typical Workflow


    1. Discover objects with `GET /v1/series`, `GET /v1/events`, and `GET
    /v1/markets`.

    2. Select a market ID or slug from discovery responses.

    3. Query historical data via `/v1/markets/{id_or_slug}/metrics`, `/prices`,
    or `/books`.
  version: 0.1.1
servers:
  - url: https://api.polymarketdata.co
    description: Production
security: []
tags:
  - name: Clients & SDKs
    description: >-
      Official client libraries and SDK guidance.


      ### Python SDK


      - Package:
      [`polymarketdata-sdk`](https://pypi.org/project/polymarketdata-sdk/)

      - Install: `pip install polymarketdata-sdk`

      - Optional dataframe extras: `pip install "polymarketdata-sdk[dataframe]"`

      - API key can be passed directly or via `POLYMARKETDATA_API_KEY`


      ### SDK Surface Map


      | Namespace | What it covers | Core methods |

      |---|---|---|

      | `client.utility` | API health and plan/rate status | `health()`,
      `usage()` |

      | `client.discovery` | entity discovery and lookup | `list_series()`,
      `list_events()`, `list_markets()`, `get_market()`, `list_tags()` |

      | `client.discovery` iterators | auto-pagination for discovery |
      `iter_series()`, `iter_events()`, `iter_markets()` |

      | `client.history` | historical market/token data |
      `get_market_metrics()`, `get_market_prices()`, `get_token_prices()`,
      `get_market_books()`, `get_token_books()` |

      | `client.history` iterators | auto-pagination for history |
      `iter_market_metrics()`, `iter_token_prices()`, `iter_token_books()` |


      ### 60-Second Quickstart


      ```python

      from polymarketdata import PolymarketDataClient


      # api_key can also be set via POLYMARKETDATA_API_KEY

      with PolymarketDataClient(api_key="YOUR_API_KEY") as client:
          health = client.utility.health()
          usage = client.utility.usage()
          print(health.status)
          print(usage.plan)
          print(usage.limits.requests_remaining)
      ```


      ### End-to-End Example (Discovery -> History)


      ```python

      from polymarketdata import PolymarketDataClient, Resolution


      with PolymarketDataClient(api_key="YOUR_API_KEY") as client:
          markets = client.discovery.list_markets(
              event_slug="us-presidential-election-2025",
              limit=5,
          )
          market_id_or_slug = markets.data[0].slug or markets.data[0].id

          metrics = client.history.get_market_metrics(
              market_id_or_slug,
              start_ts="2025-09-01T00:00:00Z",
              end_ts="2025-11-05T00:00:00Z",
              resolution=Resolution.ONE_DAY,
          )
          print(metrics.market_id, len(metrics.data))
      ```


      ### Supported Resolutions


      These match the API `resolution` enum:


      - `Resolution.ONE_MIN` (`1m`)

      - `Resolution.TEN_MIN` (`10m`)

      - `Resolution.ONE_HOUR` (`1h`)

      - `Resolution.SIX_HOUR` (`6h`)

      - `Resolution.ONE_DAY` (`1d`)


      ### DataFrame Helpers


      If installed with `polymarketdata-sdk[dataframe]`, use:

      - `to_dataframe_metrics(...)`

      - `to_dataframe_prices(...)`

      - `to_dataframe_books(...)`


      ### Errors and Retry Behavior


      All SDK exceptions inherit from `PolymarketDataError`.


      Common exception types:

      - `AuthenticationError` (401)

      - `PermissionDeniedError` (403)

      - `NotFoundError` (404)

      - `RateLimitError` (429)

      - `ServerError` (5xx)

      - `NetworkError` / `RequestTimeoutError`


      The SDK retries `429` and `5xx` responses with exponential backoff +
      jitter.

      Tune with `max_retries`, `retry_backoff_base`, `retry_backoff_max`, and
      `timeout`.


      ### Response Metadata


      Responses include:

      - `.meta` (HTTP metadata such as `status_code`, `request_id`)

      - `.raw` (unmodified response payload)
    externalDocs:
      description: Python SDK package
      url: https://pypi.org/project/polymarketdata-sdk/
  - name: Discovery
    description: >-
      Start here. Discover series, events, and markets, then use the returned
      market IDs/slugs in History endpoints.
  - name: History
    description: >-
      Retrieve historical metrics, prices, and order book snapshots for a
      specific market.
  - name: Utility
    description: Health, status, and usage endpoints.
paths:
  /v1/markets/{id_or_slug}:
    get:
      tags:
        - Discovery
      summary: Get market details
      description: >-
        Get detailed information about a specific market by ID or slug.


        Returns full market information, including tokens, description, and
        resolution status.
      operationId: get_market_detail_v1_markets__id_or_slug__get
      parameters:
        - name: id_or_slug
          in: path
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 200
            description: Market ID or market slug.
            examples:
              - '618831'
            title: Id Or Slug
          description: Market ID or market slug.
      responses:
        '200':
          description: Detailed market object with tokens and resolution metadata.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarketDetailResponse'
        '401':
          description: API key is missing, invalid, or expired.
          content:
            application/json:
              example:
                detail: Invalid or expired API key.
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Market ID/slug does not exist.
          content:
            application/json:
              example:
                detail: 'Market not found: nonexistent_market_id'
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation error for one or more request parameters.
          content:
            application/json:
              example:
                detail:
                  - loc:
                      - query
                      - limit
                    msg: Input should be less than or equal to 1000
                    type: less_than_equal
        '429':
          description: Rate limit exceeded for the current API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                detail: Rate limit exceeded. Please try again later.
        '500':
          description: Unexpected server-side error.
          content:
            application/json:
              example:
                detail: Failed to fetch data.
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    MarketDetailResponse:
      properties:
        id:
          type: string
          title: Id
          description: Unique market identifier.
          examples:
            - '618831'
        slug:
          type: string
          title: Slug
          description: Stable URL-friendly market slug.
          examples:
            - will-candidate-x-win-2025
        question:
          anyOf:
            - type: string
            - type: 'null'
          title: Question
          description: Human-readable market question.
          examples:
            - Will Candidate X win the 2025 election?
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Long-form market description, if available.
          examples:
            - Resolves to YES if Candidate X wins the 2025 election.
        status:
          type: string
          title: Status
          description: Current market status.
          examples:
            - open
        start_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Start Date
          description: Market start timestamp in ISO 8601 format.
          examples:
            - '2025-09-01T00:00:00Z'
        end_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: End Date
          description: Market end timestamp in ISO 8601 format.
          examples:
            - '2025-11-05T23:59:59Z'
        closed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Closed At
          description: Timestamp when the market was closed.
          examples:
            - '2025-11-06T03:00:00Z'
        resolved_token_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Resolved Token Id
          description: Winning token identifier when market is resolved.
          examples:
            - '12345'
        resolved_token_label:
          anyOf:
            - type: string
            - type: 'null'
          title: Resolved Token Label
          description: Winning token label when market is resolved.
          examples:
            - 'Yes'
        tokens:
          items:
            $ref: '#/components/schemas/TokenInfo'
          type: array
          title: Tokens
          description: All tokens for the market.
      type: object
      required:
        - id
        - slug
        - status
        - tokens
      title: MarketDetailResponse
      description: Detailed response for `GET /markets/{id_or_slug}`.
      example:
        description: Resolves to YES if Candidate X wins the 2025 election.
        end_date: '2025-11-05T23:59:59Z'
        id: '618831'
        question: Will Candidate X win the 2025 election?
        slug: will-candidate-x-win-2025
        start_date: '2025-09-01T00:00:00Z'
        status: open
        tokens:
          - id: '12345'
            label: 'Yes'
          - id: '12346'
            label: 'No'
    ErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Human-readable error description.
      type: object
      required:
        - detail
      title: ErrorResponse
      description: Generic API error response.
    TokenInfo:
      properties:
        id:
          type: string
          title: Id
          description: Unique token identifier.
          examples:
            - '12345'
        label:
          type: string
          title: Label
          description: Human-readable token label shown to users.
          examples:
            - 'Yes'
      type: object
      required:
        - id
        - label
      title: TokenInfo
      description: Token metadata for a market.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      description: >-
        Create an API key in the PolymarketData dashboard and send it in the
        `X-API-Key` request header.


        Example: `X-API-Key: pk_live_your_key_here`
      in: header
      name: X-API-Key

````