# CompanyEnrich State Search API

Search CompanyEnrich State via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Treg, pass parameters such as countryCodes, query, and retrieve structured data including location identifier, state or province code, state or province name, reported latitude, and reported longitude to build region selectors, normalize location records, and browse location results.

Documentation: https://openany.si/companyenrich/search-states-and-provinces/
API ID: 21740802-0b70-41af-9995-f54826d7984d
Provider: treg
Contract revision: 4
Method: POST
Endpoint: https://api.openany.si/v1/agent-apis/treg/call/companyenrich.geo.states.search
Page update time: 2026-12-03T02:36:59.501Z
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:36:59.501Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "fixed",
  "priceMicroUsd": "0",
  "rounding": null,
  "unit": "call",
  "unitQuantity": null
}
```

## Usage and limits
## CompanyEnrich State Search API

Send a JSON object with optional query, countryCodes and page. The response contains items plus page, totalItems and totalPages; name prefixes are supported for this state/province search.

## What You Can Build

- **Build region selectors**: Offer state or province candidates within selected countries.
- **Normalize location records**: Keep returned IDs and regional codes with user selections.
- **Browse location results**: Use page metadata to navigate the result set.

## Returned Data

| Field | Meaning |
| --- | --- |
| `items[].id` | Location identifier |
| `items[].code` | State or province code |
| `items[].name` | State or province name |
| `items[].latitude` | Reported latitude |
| `items[].longitude` | Reported 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 State 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 states and provinces. See individual field descriptions for input requirements.",
      "properties": {
        "countryCodes": {
          "description": "ISO alpha-2 codes to scope the search",
          "example": [
            "US"
          ],
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "page": {
          "description": "1-based page number",
          "minimum": 1,
          "type": "integer"
        },
        "query": {
          "description": "state or province name; prefixes DO work here ('cali' matched California)",
          "example": "cali",
          "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"
          },
          "id": {
            "type": "integer"
          },
          "latitude": {
            "type": "number"
          },
          "longitude": {
            "type": "number"
          },
          "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.states.search' \
  -X POST \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "countryCodes": [
    "US"
  ],
  "query": "cali"
}'
```

## 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": "CA",
      "id": 4845,
      "latitude": 36.77826,
      "longitude": -119.41793,
      "name": "California"
    }
  ],
  "page": 1,
  "totalItems": 1,
  "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
### Does the search support name prefixes?
Yes. The input description documents a prefix such as cali matching California.

### How do I restrict results to a country?
Pass countryCodes as an array of ISO alpha-2 codes, such as US.

### Is query required?
The JSON body is required, while query, countryCodes and page are optional properties in its schema.

### How do I retrieve another page?
Set page to a positive 1-based page number and use totalPages to guide navigation.

### Are state codes globally unique?
Do not use a regional code alone as a global identifier. Retain the selected country context and returned location ID.

### Does this search for companies in those states?
No. It returns state and province records. Apply selected locations in a separate company-search operation.

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