# CompanyEnrich Country Search API

Search CompanyEnrich Country via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Treg, pass parameters such as query, and retrieve structured data including country code, country name, country reference latitude, country reference longitude, and current page to populate a country selector, browse available countries, and normalize geographic filters.

Documentation: https://openany.si/companyenrich/search-countries-by-name/
API ID: 79f28870-8c7b-4833-bc8e-4070598e440b
Provider: treg
Contract revision: 4
Method: POST
Endpoint: https://api.openany.si/v1/agent-apis/treg/call/companyenrich.geo.countries.search
Page update time: 2026-12-03T02:37:01.071Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: application/json
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0 / call
The published contract currently has no usage charge. Authentication and service limits still apply.
Price source: OpenAny public API contract.
Contract update time: 2026-12-03T02:37:01.071Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "fixed",
  "priceMicroUsd": "0",
  "rounding": null,
  "unit": "call",
  "unitQuantity": null
}
```

## Usage and limits
## CompanyEnrich Country Search API

Send a JSON body with optional query and page. Country-name matching uses whole words; omitting query allows country browsing, and the response includes items with pagination totals.

## What You Can Build

- **Populate a country selector**: Resolve names into country codes for a form.
- **Browse available countries**: Omit query and navigate with page metadata.
- **Normalize geographic filters**: Store the source country code with selected labels.

## Returned Data

| Field | Meaning |
| --- | --- |
| `items[].code` | Country code |
| `items[].name` | Country name |
| `items[].latitude` | Country reference latitude |
| `items[].longitude` | Country reference longitude |
| `page` | Current page |
| `totalItems` | Total result count |
| `totalPages` | Total page count |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "CompanyEnrich Country Search API request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {}
    },
    "query": {
      "type": "object",
      "properties": {}
    },
    "headers": {
      "type": "object",
      "properties": {}
    },
    "body": {
      "additionalProperties": false,
      "description": "JSON request body for Search countries by name. See individual field descriptions for input requirements.",
      "properties": {
        "page": {
          "description": "1-based page number",
          "minimum": 1,
          "type": "integer"
        },
        "query": {
          "description": "country name. WHOLE WORDS ONLY — verified live 2026-08-20: 'United States' and 'Ireland' match, but the prefix 'germ' returns zero items. Omit it to page through every country",
          "example": "United States",
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [],
      "type": "object"
    }
  },
  "required": [
    "path",
    "query",
    "headers",
    "body"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "latitude": {
            "type": "integer"
          },
          "longitude": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          }
        }
      }
    },
    "page": {
      "type": "integer"
    },
    "totalItems": {
      "type": "integer"
    },
    "totalPages": {
      "type": "integer"
    }
  }
}
```

## Request example
Scenario: Third-party reference · Testnet verified: business + billing
```bash
curl \
  'https://api.openany.si/v1/agent-apis/treg/call/companyenrich.geo.countries.search' \
  -X POST \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "query": "United States"
}'
```

## Response example
Historical third-party reference. It may differ from the current provider response; verify the original contract before use.
Third-party response reference · Documented HTTP 200
```json
{
  "items": [
    {
      "code": "UM",
      "latitude": 0,
      "longitude": 0,
      "name": "United States Minor Outlying Islands"
    },
    {
      "code": "US",
      "latitude": 38,
      "longitude": -97,
      "name": "United States"
    }
  ],
  "page": 1,
  "totalItems": 2,
  "totalPages": 1
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

## Common questions
### Can I search with a prefix such as germ?
Use whole country-name words. The contract documents that a prefix such as germ does not match.

### How do I browse countries without a search term?
Send a JSON body without query and use the 1-based page parameter.

### Can one name query return multiple countries or territories?
Yes. Inspect each code and name rather than assuming that a text query identifies exactly one record.

### Can I look up a known ISO code here?
Use the separate CompanyEnrich Country Lookup API when you already have an ISO alpha-2 code.

### Does a zero coordinate mean an exact location at zero?
Do not treat country reference coordinates as verified physical locations. Evaluate missing or placeholder-like values before mapping.

### Does this return companies in a country?
No. It returns country records. A company search is a separate operation.

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
