# Look up country ASNs

Find numeric ASNs available for a selected country.

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

## Workflow

1. **Select a country**

   Use a two-letter country value from Location/Search.

2. **Read ASN values**

   Send countryCode and read body[].asn. For residential proxies, pass the numeric value without AS to Generate.Asn together with Country.

## Parameters

| Name | Location | Type | Use | Description |
| --- | --- | --- | --- | --- |
| `Authorization` | `HEADER` | `string` | Required | Bearer `<YOUR_API_KEY>`. |
| `countryCode` | `QUERY` | `string` | Required | Exactly two English letters, for example US; case is normalized. |

## Examples

### cURL

```bash
curl -X GET 'https://www.arcvenza.com/api/Location/GetAsnsByCountryCode?countryCode=US' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <YOUR_API_KEY>'
```

### JavaScript

```javascript
const response = await fetch("https://www.arcvenza.com/api/Location/GetAsnsByCountryCode?countryCode=US", {
  headers: {
    Accept: "application/json",
    Authorization: `Bearer ${process.env.ARCVENZA_API_KEY}`,
  },
});

console.log(await response.json());
```

### Python

```python
import os
import requests

response = requests.get(
    "https://www.arcvenza.com/api/Location/GetAsnsByCountryCode?countryCode=US",
    headers={
        "Accept": "application/json",
        "Authorization": f"Bearer {os.environ['ARCVENZA_API_KEY']}",
    },
    timeout=30,
)
print(response.json())
```

## Success response

`200 · application/json`

```json
{
  "code": 200,
  "message": "Success",
  "body": [{ "asn": 7922, "asnInfo": null }]
}
```

## 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

- ASN values depend on the selected country; asnInfo may be null. This lookup does not consume traffic or grant proxy access.

## 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/country-asns.md and use https://www.arcvenza.com/llms.txt to find related guides. Cite https://www.arcvenza.com/docs/api/country-asns 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=country-asns#send-request)

[llms.txt](/llms.txt)

