# Canvassed Data API: agent onboarding

Use the Canvassed Data API to retrieve current commercial listing records, listing summaries, and listing history. This guide contains setup facts and safe request examples; the OpenAPI document is the machine-readable endpoint contract.

## Connection details

- Base URL: https://api.canvassed.ai
- Authentication: send the account's API key in the `API-Key` HTTP header.
- Reference: [API reference](https://www.canvassed.ai/developers/api/reference)
- OpenAPI contract: [OpenAPI JSON](https://www.canvassed.ai/openapi.json)

## Access prerequisites

You need a Canvassed account with a confirmed email address, API access enabled for the product or endpoint you need, and an API key authorized for that access. API keys only access the products included in the account's grants. If you need access, [contact Canvassed](https://www.canvassed.ai/contact-us) and specify Listings, Listings Summary, or another endpoint you need.

Trial access may be time-limited and scoped to a specific endpoint or capability. Confirm its included endpoints, limits, and end date with the invitation or Canvassed contact. You can create a key in **Profile → API Key Management** if your account does not already have one. Trial keys cannot be rotated from Profile; contact Canvassed for a replacement, an extension, or access to another capability. With non-trial access, you can create or rotate a user-managed key in Profile. A rotated key is shown in full only once.

## Products

- **Listings:** current listing records from `GET /api/v1/data/listings`.
- **Listings Summary:** aggregate counts and breakdowns from `GET /api/v1/data/search-summary`; this product does not return listing rows. Current filter-value lookup routes require Premium Data access.
- **Listings History:** current and historical listing lifespans from `GET /api/v1/data/listings/history`. History requests require a temporal filter and may need separate account access.

## First request

Replace `YOUR_API_KEY` with the key issued for your own account. These are live requests: a successful response may count against a trial or paid allowance. Do not put a real key in source code, a prompt, a shared document, or a URL. Store it in a secrets manager or a local environment variable.

### cURL

```sh
API_KEY="YOUR_API_KEY"
curl --get "https://api.canvassed.ai/api/v1/data/listings" \
  -H "API-Key: $API_KEY" \
  --data-urlencode 'zip=02108,02109' \
  --data-urlencode 'per_page=20' \
  --data-urlencode 'page=1'
```

### Python

```python
import os
import requests

api_key = os.environ["CANVASSED_API_KEY"]
response = requests.get(
    "https://api.canvassed.ai/api/v1/data/listings",
    headers={"API-Key": api_key},
    params={"zip": "02108,02109", "per_page": 20, "page": 1},
    timeout=30,
)
response.raise_for_status()
payload = response.json()
print(f"items={len(payload.get('items', []))}")
```

The examples use exact ZIP codes; preserve leading zeroes. Separate filters narrow results together (AND), while comma-separated values in one filter match any listed value (OR). See the API reference for all parameters and response formats.

## Allowance and common errors

Successful requests may use the trial or paid allowance associated with your account. Review the access terms for the enabled product before running large or repeated requests.

- **401:** the key may be missing, invalid, expired, or revoked.
- **403:** the key may not have access to that product or endpoint.
- **402:** an allowance or spending limit may have been reached.
- **429:** the rate-limit window may need to reset before retrying.

## References

- [Human API onboarding](https://www.canvassed.ai/developers/api/onboarding)
- [API reference](https://www.canvassed.ai/developers/api/reference)
- [OpenAPI JSON contract](https://www.canvassed.ai/openapi.json)
- [Request API access or get help](https://www.canvassed.ai/contact-us)
