DATPAQ Country Codes API

ISO 3166-1 country lookup, search, fuzzy match, and export

Operations 5

GET /country-codes/countries List all countries #
GET /country-codes/countries/search Search countries #
GET /country-codes/countries/match Exact or fuzzy country match #
GET /country-codes/countries/{code} Look up a country by code #
GET /country-codes/export Export all 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/datpaq-com:datpaq-com-country-codes-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. See our Privacy Policy and Terms.

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

OpenAPI Specification

datpaq-com-country-codes-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Datpaq Com Country Codes API
  version: 1.1.0
  contact:
    name: Datpaq Support
    url: https://datpaq.com
  license:
    name: Proprietary
  description: 'Operations tagged Country Codes across 2 of this provider''s published API definitions: datpaq-com.yaml, datpaq-com-openapi.yaml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://datpaq.com/api/v1
  description: Production
- url: https://staging.datpaq.com/api/v1
  description: Staging
security:
- ApiKeyHeader: []
- ApiKeyQuery: []
tags:
- name: Country Codes
  description: ISO 3166-1 country lookup, search, fuzzy match, and export
paths:
  /country-codes/countries:
    get:
      tags:
      - Country Codes
      operationId: countryCodesList
      summary: List all countries
      description: All ISO 3166-1 countries sorted by name, with ISO2, ISO3, and numeric codes.
      responses:
        '200':
          description: Country list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccess'
              example:
                success: true
                data:
                - name: United States
                  iso2: US
                  iso3: USA
                  numeric: '840'
                metadata:
                  correlationId: abc123-def456
                  timestamp: '2026-08-20T12:00:00.000Z'
                  processingTime: 12ms
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        default:
          $ref: '#/components/responses/ServiceUnavailable'
    servers:
    - url: https://datpaq.com/api/v1
      description: Production
    - url: https://staging.datpaq.com/api/v1
      description: Staging
  /country-codes/countries/search:
    get:
      tags:
      - Country Codes
      operationId: countryCodesSearch
      summary: Search countries
      description: Requires q. Matches name, ISO2, ISO3, or numeric code. Limited to 25 rows.
      responses:
        '200':
          description: Matching countries
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccess'
              example:
                success: true
                data:
                - name: United States
                  iso2: US
                  iso3: USA
                  numeric: '840'
                metadata:
                  correlationId: abc123-def456
                  timestamp: '2026-08-20T12:00:00.000Z'
                  processingTime: 10ms
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        default:
          $ref: '#/components/responses/ServiceUnavailable'
      parameters:
      - name: q
        in: query
        required: true
        description: Search text
        schema:
          type: string
          example: united
    servers:
    - url: https://datpaq.com/api/v1
      description: Production
    - url: https://staging.datpaq.com/api/v1
      description: Staging
  /country-codes/countries/match:
    get:
      tags:
      - Country Codes
      operationId: countryCodesMatch
      summary: Exact or fuzzy country match
      description: Requires q. Tries exact ISO/numeric match, then PostgreSQL similarity on the country name.
      responses:
        '200':
          description: Best country match
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccess'
              example:
                success: true
                data:
                  name: United States
                  iso2: US
                  iso3: USA
                  numeric: '840'
                  similarity: 0.91
                metadata:
                  correlationId: abc123-def456
                  timestamp: '2026-08-20T12:00:00.000Z'
                  processingTime: 9ms
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        default:
          $ref: '#/components/responses/ServiceUnavailable'
      parameters:
      - name: q
        in: query
        required: true
        description: Code or country name
        schema:
          type: string
          example: United Stat
    servers:
    - url: https://datpaq.com/api/v1
      description: Production
    - url: https://staging.datpaq.com/api/v1
      description: Staging
  /country-codes/countries/{code}:
    get:
      tags:
      - Country Codes
      operationId: countryCodesLookup
      summary: Look up a country by code
      description: Resolve ISO2, ISO3, or numeric code to a full country record.
      responses:
        '200':
          description: Country record
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccess'
              example:
                success: true
                data:
                  name: United States
                  iso2: US
                  iso3: USA
                  numeric: '840'
                metadata:
                  correlationId: abc123-def456
                  timestamp: '2026-08-20T12:00:00.000Z'
                  processingTime: 6ms
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        default:
          $ref: '#/components/responses/ServiceUnavailable'
      parameters:
      - name: code
        in: path
        required: true
        description: ISO2, ISO3, or numeric code
        schema:
          type: string
          example: US
    servers:
    - url: https://datpaq.com/api/v1
      description: Production
    - url: https://staging.datpaq.com/api/v1
      description: Staging
  /country-codes/export:
    get:
      tags:
      - Country Codes
      operationId: countryCodesExport
      summary: Export all countries
      description: JSON by default. format=csv returns a CSV attachment.
      responses:
        '200':
          description: Exported country data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccess'
              example:
                success: true
                data:
                - name: United States
                  iso2: US
                  iso3: USA
                  numeric: '840'
                metadata:
                  correlationId: abc123-def456
                  timestamp: '2026-08-20T12:00:00.000Z'
                  processingTime: 15ms
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        default:
          $ref: '#/components/responses/ServiceUnavailable'
      parameters:
      - name: format
        in: query
        required: false
        description: json or csv
        schema:
          type: string
          enum:
          - json
          - csv
          example: json
    servers:
    - url: https://datpaq.com/api/v1
      description: Production
    - url: https://staging.datpaq.com/api/v1
      description: Staging
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Human-readable error message
          example: Invalid API key
        correlationId:
          type: string
          description: Request tracking identifier for support
          example: abc123-def456-789ghi
        service:
          type: string
          description: Service name that produced the error
          example: ip-geolocation
    GenericSuccess:
      type: object
      description: Standard success envelope. The data property structure varies by endpoint.
      properties:
        correlationId:
          type: string
          description: Request tracking identifier
          example: abc123-def456
        data:
          type: object
          description: Response payload (structure varies by endpoint)
        cached:
          type: boolean
          description: Whether the response was served from cache
          example: false
  responses:
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    BadRequest:
      description: Bad request — missing or invalid parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    RateLimited:
      description: Rate limit exceeded — retry after the indicated period
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ServiceUnavailable:
      description: Service temporarily unavailable
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized — missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: API key passed via x-api-key request header
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api_key
      description: API key passed as api_key query parameter
x-refined-from:
- datpaq-com.yaml
- datpaq-com-openapi.yaml