# Look up countries, states and cities

Get valid location values before generating a residential proxy.

- **Endpoint** `https://www.arcvenza.com/api/Location/Search`
- **Authentication** `Bearer account API key`
- **Protocol** `HTTPS · application/json`

## Workflow

1. **List countries**

   Send mealType=basic without countryCode or stateCode.

2. **List states**

   Send a returned country value as countryCode.

3. **List cities**

   Send countryCode and a returned state value as stateCode. Use the resulting city value in Generate.City.

## Parameters

| Name | Location | Type | Use | Description |
| --- | --- | --- | --- | --- |
| `Authorization` | `HEADER` | `string` | Required | Bearer `<YOUR_API_KEY>`. |
| `mealType` | `BODY` | `string` | Required | Use basic for residential location values. |
| `countryCode` | `BODY` | `string` | Optional | Omit for countries; send a returned country value for states or cities. |
| `stateCode` | `BODY` | `string` | Optional | Omit for countries or states; send a returned state value for cities. |

## Examples

### Countries

```bash
curl -X POST 'https://www.arcvenza.com/api/Location/Search' \
  -H 'Authorization: Bearer <YOUR_API_KEY>' \
  -H 'Content-Type: application/json' \
  --data '{"mealType":"basic"}'
```

### States

```bash
curl -X POST 'https://www.arcvenza.com/api/Location/Search' \
  -H 'Authorization: Bearer <YOUR_API_KEY>' \
  -H 'Content-Type: application/json' \
  --data '{"mealType":"basic","countryCode":"US"}'
```

### Cities

```bash
curl -X POST 'https://www.arcvenza.com/api/Location/Search' \
  -H 'Authorization: Bearer <YOUR_API_KEY>' \
  -H 'Content-Type: application/json' \
  --data '{"mealType":"basic","countryCode":"US","stateCode":"CA"}'
```

## Success response

`200 · application/json`

```json
{
  "code": 200,
  "message": "Success",
  "body": [{ "label": "United States", "value": "US", "weight": 0 }]
}
```

## Error response

HTTP 401 means the account API key is missing, invalid, or reset. For HTTP 403, check that the key type and the requested operation are supported. Check the HTTP status before parsing the body.

```http
HTTP/1.1 401 Unauthorized
```

For JSON responses, check that `code` is `200` before using `body`. For a business error, read `message` and correct the request before retrying.

## Troubleshooting and notes

- Use body[].value, not the display label, in the next lookup and proxy request. Ignore random/empty entries for nested lookups. Lookup does not purchase or consume traffic.

## Related resources

- [API reference](/docs/api)
- [Authentication](/docs/authentication#account-api-key)

## AI integration prompt

```text
Read the Arcvenza Markdown at https://www.arcvenza.com/docs/markdown/api/location-search.md and use https://www.arcvenza.com/llms.txt to find related guides. Cite https://www.arcvenza.com/docs/api/location-search for this page. Ask what I want to integrate, then identify the correct product, endpoint and authentication method. Confirm the required access before sending a live request through API Playground, and show how to supply credentials through environment variables. Indicate any account, plan or usage requirements and flag anything the docs do not establish.
```

[Open API Playground](/docs/playground?endpoint=location-search#send-request)

[llms.txt](/llms.txt)

