Country.io · API Governance Rules

Country.io API Rules

Spectral linting rules defining API design standards and conventions for Country.io.

7 Rules error 6 warn 1
View Rules File View on GitHub

Rule Categories

country

Rules

error
country-io-info-title
API title must mention Country.io.
$.info.title
warn
country-io-server
Servers must reference https://country.io.
$.servers[*].url
error
country-io-paths-json
All Country.io data paths must end in .json.
$.paths
error
country-io-get-only
Country.io data endpoints must only support GET.
$.paths.*
error
country-io-operation-id
Operations must define an operationId.
$.paths.*.get
error
country-io-tags
Operations must define at least one tag.
$.paths.*.get
error
country-io-200-json-response
Each endpoint must define a 200 application/json response.
$.paths.*.get.responses.200.content

Spectral Ruleset

Raw ↑
extends: ["spectral:oas"]
documentationUrl: https://country.io/data/
rules:
  country-io-info-title:
    description: API title must mention Country.io.
    given: "$.info.title"
    severity: error
    then:
      function: pattern
      functionOptions:
        match: "Country.io"
  country-io-server:
    description: Servers must reference https://country.io.
    given: "$.servers[*].url"
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "country.io"
  country-io-paths-json:
    description: All Country.io data paths must end in .json.
    given: "$.paths"
    severity: error
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          patternProperties:
            "^/[a-z0-9_-]+\\.json$": {}
          additionalProperties: false
  country-io-get-only:
    description: Country.io data endpoints must only support GET.
    given: "$.paths.*"
    severity: error
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          properties:
            get:
              type: object
          additionalProperties: false
  country-io-operation-id:
    description: Operations must define an operationId.
    given: "$.paths.*.get"
    severity: error
    then:
      field: operationId
      function: truthy
  country-io-tags:
    description: Operations must define at least one tag.
    given: "$.paths.*.get"
    severity: error
    then:
      field: tags
      function: truthy
  country-io-200-json-response:
    description: Each endpoint must define a 200 application/json response.
    given: "$.paths.*.get.responses.200.content"
    severity: error
    then:
      field: application/json
      function: truthy

Work with this as data

Every ruleset 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 spectral rules

4 MCP tools reach this
  • find_rulesBrowse and filter every ruleset in the catalog.
  • 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 ruleset
curl "https://apis.io/api/v1/rules/country-io-data-rules"
All spectral rules
curl "https://apis.io/api/v1/rules?limit=25"

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

Get an API key

Free tier, no email required.

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