pdata Countries API

The countries API from pdata — 1 operation(s) for countries.

GitHub OpenAPI

Operations 1

GET /api/v1/countries List Countries #

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/pdata-world:pdata-world-countries-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

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. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

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

OpenAPI Specification

pdata-world-countries-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: 'pdata.world API: prediction-market data across 8 platforms…'
  description: 'pdata is a read-only aggregator of live prediction-market data across 8 platforms (Polymarket, Kalshi, Manifold, Myriad, Limitless, Predict, Opinion, Gemini). All endpoints are public; no auth, no key, no paid tier.


    Please send a descriptive `User-Agent` naming your app or agent and a URL where its operator can be reached, so a misbehaving client can be contacted instead of blocked. Fair use: at most 50 requests a second per IP address, with bursts of up to 100; for everything at once, use the nightly bulk files at https://api.pdata.world/bulk/.


    **For AI agents:** a Model Context Protocol server is mounted at https://api.pdata.world/mcp exposing 15 of its operations as tools. For non-MCP agents, a plain JSON descriptor of the MCP surface is available at https://api.pdata.world/api/v1/mcp-info. Quickstart guide: https://pdata.world/agents.md. Verbose index with curl examples: https://pdata.world/llms-full.txt.'
  version: 2.8.0
  contact:
    name: pdata agent guide
    url: https://pdata.world/agents
  license:
    name: CC BY 4.0 (pdata aggregation; source data subject to each venue's terms)
    url: https://creativecommons.org/licenses/by/4.0/
  termsOfService: https://pdata.world/about
servers:
- url: https://api.pdata.world
  description: Production
tags:
- name: Countries
paths:
  /api/v1/countries:
    get:
      tags:
      - Countries
      summary: List Countries
      description: 'Use when an agent needs the list of country tags that markets have been tagged with. Returns the canonical country vocabulary with per-country market counts. Accepts the same filter params as `list_markets` (source, category, status, volume/probability ranges, search, …): the counts then reflect that filtered population, so this doubles as a facet endpoint. The country dimension itself is ignored when computing counts, so passing `country=` does not collapse the menu. Useful as the menu source for the `country=` filter on `list_events` / `list_markets` / `top_movers`.'
      operationId: list_countries
      parameters:
      - name: spread_min
        in: query
        required: false
        schema:
          anyOf:
          - type: number
            maximum: 1
            minimum: 0
          - type: 'null'
          description: Minimum bid-ask spread (0-1). Higher = less liquid.
          title: Spread Min
        description: Minimum bid-ask spread (0-1). Higher = less liquid.
      - name: spread_max
        in: query
        required: false
        schema:
          anyOf:
          - type: number
            maximum: 1
            minimum: 0
          - type: 'null'
          description: Maximum bid-ask spread (0-1). Lower = more liquid.
          title: Spread Max
        description: Maximum bid-ask spread (0-1). Lower = more liquid.
      - name: probability_min
        in: query
        required: false
        schema:
          anyOf:
          - type: number
            maximum: 1
            minimum: 0
          - type: 'null'
          description: Minimum probability (0-1). Filters to markets above this implied probability.
          title: Probability Min
        description: Minimum probability (0-1). Filters to markets above this implied probability.
      - name: probability_max
        in: query
        required: false
        schema:
          anyOf:
          - type: number
            maximum: 1
            minimum: 0
          - type: 'null'
          description: Maximum probability (0-1).
          title: Probability Max
        description: Maximum probability (0-1).
      - name: prob_24h_change_min
        in: query
        required: false
        schema:
          anyOf:
          - type: number
            maximum: 1
            minimum: -1
          - type: 'null'
          description: Minimum 24h probability change (-1 to 1, signed). Use 0.15 for >=15pp positive moves.
          title: Prob 24H Change Min
        description: Minimum 24h probability change (-1 to 1, signed). Use 0.15 for >=15pp positive moves.
      - name: prob_24h_change_max
        in: query
        required: false
        schema:
          anyOf:
          - type: number
            maximum: 1
            minimum: -1
          - type: 'null'
          description: Maximum 24h probability change (-1 to 1, signed).
          title: Prob 24H Change Max
        description: Maximum 24h probability change (-1 to 1, signed).
      - name: volume_24h_change_min
        in: query
        required: false
        schema:
          anyOf:
          - type: number
          - type: 'null'
          description: Minimum 24h notional volume change (signed USD; e.g. 1000 means +$1k vs prior 24h).
          title: Volume 24H Change Min
        description: Minimum 24h notional volume change (signed USD; e.g. 1000 means +$1k vs prior 24h).
      - name: volume_24h_change_max
        in: query
        required: false
        schema:
          anyOf:
          - type: number
          - type: 'null'
          description: Maximum 24h notional volume change (signed USD).
          title: Volume 24H Change Max
        description: Maximum 24h notional volume change (signed USD).
      - name: source
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: 'Source name(s); single value or comma-separated list. Allowed: polymarket, kalshi, manifold, myriad, limitless, predict, opinion, gemini.'
          title: Source
        description: 'Source name(s); single value or comma-separated list. Allowed: polymarket, kalshi, manifold, myriad, limitless, predict, opinion, gemini.'
      - name: active
        in: query
        required: false
        schema:
          anyOf:
          - type: boolean
          - type: 'null'
          description: Filter by `active` flag (true/false).
          title: Active
        description: Filter by `active` flag (true/false).
      - name: closed
        in: query
        required: false
        schema:
          anyOf:
          - type: boolean
          - type: 'null'
          description: Filter by `closed` flag (true/false). Open markets are `closed=false`.
          title: Closed
        description: Filter by `closed` flag (true/false). Open markets are `closed=false`.
      - name: volume_24hr_min
        in: query
        required: false
        schema:
          anyOf:
          - type: number
            minimum: 0
          - type: 'null'
          description: Minimum 24h notional volume (USD). Excludes low-activity markets.
          title: Volume 24Hr Min
        description: Minimum 24h notional volume (USD). Excludes low-activity markets.
      - name: volume_24hr_max
        in: query
        required: false
        schema:
          anyOf:
          - type: number
            minimum: 0
          - type: 'null'
          description: Maximum 24h notional volume (USD).
          title: Volume 24Hr Max
        description: Maximum 24h notional volume (USD).
      - name: volume_min
        in: query
        required: false
        schema:
          anyOf:
          - type: number
            minimum: 0
          - type: 'null'
          description: Minimum cumulative volume (USD). Excludes low-activity markets across full history.
          title: Volume Min
        description: Minimum cumulative volume (USD). Excludes low-activity markets across full history.
      - name: volume_max
        in: query
        required: false
        schema:
          anyOf:
          - type: number
            minimum: 0
          - type: 'null'
          description: Maximum cumulative volume (USD).
          title: Volume Max
        description: Maximum cumulative volume (USD).
      - name: rank_min
        in: query
        required: false
        schema:
          anyOf:
          - type: number
            maximum: 100
            minimum: 0
          - type: 'null'
          description: Minimum rank score (numeric). Higher = more prominent.
          title: Rank Min
        description: Minimum rank score (numeric). Higher = more prominent.
      - name: rank_max
        in: query
        required: false
        schema:
          anyOf:
          - type: number
            maximum: 100
            minimum: 0
          - type: 'null'
          description: Maximum rank score (numeric).
          title: Rank Max
        description: Maximum rank score (numeric).
      - name: ends_after
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          description: Filter to events whose end_date >= this ISO 8601 datetime (e.g. `2026-06-01T00:00:00Z`).
          title: Ends After
        description: Filter to events whose end_date >= this ISO 8601 datetime (e.g. `2026-06-01T00:00:00Z`).
      - name: ends_before
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          description: Filter to events whose end_date <= this ISO 8601 datetime.
          title: Ends Before
        description: Filter to events whose end_date <= this ISO 8601 datetime.
      - name: hide_ended
        in: query
        required: false
        schema:
          type: boolean
          description: If true, hide markets/events whose end_date is in the past (end_date <= now()); rows with no end_date are kept.
          default: false
          title: Hide Ended
        description: If true, hide markets/events whose end_date is in the past (end_date <= now()); rows with no end_date are kept.
      - name: created_after
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          description: Filter to rows whose created_at >= this ISO 8601 datetime (first appearance in pdata's database).
          title: Created After
        description: Filter to rows whose created_at >= this ISO 8601 datetime (first appearance in pdata's database).
      - name: created_before
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          description: Filter to rows whose created_at <= this ISO 8601 datetime.
          title: Created Before
        description: Filter to rows whose created_at <= this ISO 8601 datetime.
      - name: status
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Comma-separated status list; any of {open, closing-soon, resolved}
          title: Status
        description: Comma-separated status list; any of {open, closing-soon, resolved}
      - name: search
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            minLength: 1
            maxLength: 200
          - type: 'null'
          description: Full-text search, English word stems, case- and accent-insensitive. Every word must match somewhere in the title, description, tags or categories; an event also matches through its markets' questions. Write `or` between alternatives, put a phrase in "double quotes", and prefix a word with `-` to exclude it (e.g. `fed -powell`). A close spelling of a word in the title also matches, so a typo still finds it. Queries shorter than 3 characters are a plain substring match on the title. Fewer, more distinctive words work best.
          title: Search
        description: Full-text search, English word stems, case- and accent-insensitive. Every word must match somewhere in the title, description, tags or categories; an event also matches through its markets' questions. Write `or` between alternatives, put a phrase in "double quotes", and prefix a word with `-` to exclude it (e.g. `fed -powell`). A close spelling of a word in the title also matches, so a typo still finds it. Queries shorter than 3 characters are a plain substring match on the title. Fewer, more distinctive words work best.
      - name: sort
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: 'Field name; prefix ''-'' for descending order (e.g. `-volume_24hr`). Common allowed values: `volume_24hr`, `normalized_vol_24hr`, `liquidity`, `end_date`, `closed_time`, `updated_at`. Markets endpoints additionally accept `probability`, `prob_24h_change`, `spread`. Invalid values return 400.'
          title: Sort
        description: 'Field name; prefix ''-'' for descending order (e.g. `-volume_24hr`). Common allowed values: `volume_24hr`, `normalized_vol_24hr`, `liquidity`, `end_date`, `closed_time`, `updated_at`. Markets endpoints additionally accept `probability`, `prob_24h_change`, `spread`. Invalid values return 400.'
      - name: categories
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Comma-separated category labels to include (OR)
          title: Categories
          examples:
          - Elections
        description: Comma-separated category labels to include (OR)
      - name: categories_exclude
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Comma-separated category labels to exclude
          title: Categories Exclude
        description: Comma-separated category labels to exclude
      - name: hide_price_derivatives
        in: query
        required: false
        schema:
          type: boolean
          description: If true, exclude events with is_price_derivative=TRUE
          default: false
          title: Hide Price Derivatives
        description: If true, exclude events with is_price_derivative=TRUE
      - name: include_uncategorized
        in: query
        required: false
        schema:
          type: boolean
          description: If true, the include clause also matches rows whose categories array is empty/NULL or contains only labels outside the canonical set (synthetic 'Other' bucket).
          default: false
          title: Include Uncategorized
        description: If true, the include clause also matches rows whose categories array is empty/NULL or contains only labels outside the canonical set (synthetic 'Other' bucket).
      - name: countries
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Comma-separated country names to include (OR). Full English names per the AI categorizer's prompt — e.g. 'United States', 'United Kingdom', 'European Union'. No allow-list — misspelled values silently yield zero matches.
          title: Countries
        description: Comma-separated country names to include (OR). Full English names per the AI categorizer's prompt — e.g. 'United States', 'United Kingdom', 'European Union'. No allow-list — misspelled values silently yield zero matches.
      - name: countries_exclude
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Comma-separated country names to exclude.
          title: Countries Exclude
        description: Comma-separated country names to exclude.
      - name: include_uncountried
        in: query
        required: false
        schema:
          type: boolean
          description: If true, the include clause also matches rows whose countries array is empty/NULL — country-agnostic markets (synthetic 'No country' bucket).
          default: false
          title: Include Uncountried
        description: If true, the include clause also matches rows whose countries array is empty/NULL — country-agnostic markets (synthetic 'No country' bucket).
      - name: country_match
        in: query
        required: false
        schema:
          type: string
          pattern: ^(any|all)$
          description: 'How multiple `countries` combine: ''any'' (default, OR — tagged with any selected country) or ''all'' (AND — tagged with all of them, e.g. both Iran and Israel). Markets carry ≤3 country tags.'
          default: any
          title: Country Match
        description: 'How multiple `countries` combine: ''any'' (default, OR — tagged with any selected country) or ''all'' (AND — tagged with all of them, e.g. both Iran and Israel). Markets carry ≤3 country tags.'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CountriesOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '400':
          description: 'Bad request: an unknown query parameter, an unknown source, a missing argument, or an invalid value or range. `code` says which; `message` lists what is allowed or what to call first.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorOut'
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ResponseMetaList:
      properties:
        attribution:
          type: string
          title: Attribution
          description: Who aggregated this data, under which licence, and whose data it is.
          default: Data aggregated by pdata.world (https://pdata.world) from Polymarket, Kalshi, Manifold, Myriad, Limitless, Predict, Opinion and Gemini; CC BY 4.0; source data © each venue.
        canonical_url:
          type: string
          title: Canonical Url
          description: 'Stable URL for this resource: the pdata.world page, or the API URL for list responses.'
        as_of:
          type: string
          format: date-time
          title: As Of
          description: When this response was generated (UTC).
        docs:
          type: string
          title: Docs
          description: API documentation.
          default: https://api.pdata.world/docs
        hint:
          anyOf:
          - type: string
          - type: 'null'
          title: Hint
          description: 'Advice for the next call, present only when there is some: today, why a search may have come back empty and where else to look. Absent otherwise.'
        total_capped:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Total Capped
          description: 'Set on `?search=` and `/search/suggest` responses only. `true` when more rows matched than the search inspects (20,000 per table; 5,000 for the typo-tolerant fallback): `meta.total` (or `total_events` / `total_markets`) is then a lower bound, not the exact count. `/markets` pages normally stay in exact order. `/events` stays in exact order for events matched by their own text and may miss events matched only through a child market. `/search/suggest` ranks the inspected rows only. Absent when the count is exact.'
      type: object
      required:
      - canonical_url
      title: ResponseMetaList
      description: Agent metadata for list/aggregate responses (no cite_as).
    CountryCount:
      properties:
        name:
          type: string
          title: Name
          description: Country, full English name, as pdata's AI tagging writes it.
        count:
          type: integer
          title: Count
          description: Number of markets tagged with this country among those matching the request's filters (status, source, category and so on); a market tagged with several countries counts once for each.
      type: object
      required:
      - name
      - count
      title: CountryCount
      description: Single country + how many AI-evaluated markets are tagged with it.
    CountriesOut:
      properties:
        items:
          items:
            $ref: '#/components/schemas/CountryCount'
          type: array
          title: Items
          description: Countries, most markets first.
        _meta:
          anyOf:
          - $ref: '#/components/schemas/ResponseMetaList'
          - type: 'null'
          description: 'Response metadata: attribution, canonical URL, as-of time and docs link.'
      type: object
      required:
      - items
      title: CountriesOut
      description: 'Envelope for /api/v1/countries. Added in Spec 3 D1 to carry `_meta`.


        Pre-Spec-3 the endpoint returned a bare `list[CountryCount]`; agents

        that mandate "every API response carries `_meta`" need an envelope.

        The frontend unwraps `.items` in `lib/api/countries.ts` so existing

        component code continues to receive an array.'
    ErrorOut:
      description: The body of every error response.
      properties:
        code:
          title: Code
          type: string
          description: Machine-readable reason, e.g. `unknown_param`, `invalid_source`, `missing_argument`, `not_found`.
        message:
          title: Message
          type: string
          description: What went wrong and what to send instead, in one or two sentences.
        detail:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          default: null
          title: Detail
          description: 'Structured extras when there are any: `missing` and `next_tool` for `missing_argument`, `did_you_mean` (closest documented paths) for an unknown path.'
        docs:
          default: https://api.pdata.world/docs
          title: Docs
          type: string
          description: API documentation.
        home:
          default: https://api.pdata.world/
          title: Home
          type: string
          description: The API's front door, which links every surface.
      required:
      - code
      - message
      title: ErrorOut
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
externalDocs:
  url: https://pdata.world/agents
  description: Agent quickstart — MCP setup, citation policy, schema policy.