# Quickstart Ten minutes with a sandbox key. The [sandbox](guides/sandbox.md) is a made-up world that answers exactly like live, so everything below works unchanged on live once you swap the keys. **Get your keys:** sign up in the [portal](https://app.apidata.one) with your email address. Your sandbox account is ready at once, with a test key pair: `sk_test_…` for your server and `pk_test_…` for the browser. Each key is shown once, so copy it then; a key you lose is revoked and replaced on the account's keys page. Every call goes to `https://api.apidata.one/v1` with `Authorization: Bearer `. ```bash export SK_TEST="sk_test_…" # your secret test key: on your server only, never in a page ``` ## 1. Search ```bash curl -H "Authorization: Bearer $SK_TEST" "https://api.apidata.one/v1/listings?status=active&price.max=500000&limit=3" ``` The answer holds `data` (the listings), `meta` (paging and `dataLastUpdatedAt`) and `compliance` (the notices your pages must show). See [listings](reference/listings.md). ## 2. One listing ```bash curl -H "Authorization: Bearer $SK_TEST" "https://api.apidata.one/v1/listings/SBX900000009" ``` `SBX900000009` is one of the sandbox's [listings that never change](guides/sandbox.md#listings-that-never-change): it always has 150 photos. Try `SBX900000001` to see how a hidden address looks. ## 3. A consumer's favorite Your server speaks for one of your site's users with `X-Client-Id`, an ID of your own for that user (never an email address): ```bash curl -X POST -H "Authorization: Bearer $SK_TEST" -H "X-Client-Id: user-42" -H "Content-Type: application/json" \ -d '{"listingKey":"SBX900000009"}' "https://api.apidata.one/v1/favorites" ``` In the browser, use the `pk_test_…` key with a [client token](reference/endpoints/create-client-token.md) instead. See [authentication](concepts/authentication.md). ## 4. A saved search, and an alert on demand ```bash curl -X POST -H "Authorization: Bearer $SK_TEST" -H "X-Client-Id: user-42" -H "Content-Type: application/json" \ -d '{"criteria":{"status":["active"],"price":{"max":500000}},"alertFrequency":"instant"}' \ "https://api.apidata.one/v1/saved-searches" ``` The sandbox changes by itself every 5 minutes, so this search will alert before long. To see it now, send a [sandbox trigger](reference/sandbox-triggers.md) with the `id` you just got: ```bash curl -X POST -H "Authorization: Bearer $SK_TEST" -H "X-Client-Id: user-42" -H "Content-Type: application/json" \ -d '{"event":"saved_search.matches","savedSearchId":""}' "https://api.apidata.one/v1/sandbox/triggers" ``` ## 5. Read the notice ```bash curl -H "Authorization: Bearer $SK_TEST" "https://api.apidata.one/v1/events" ``` Within about 10 seconds the list holds a `saved_search.matches` notice naming the new listing. **While you build on your own computer, this list is how you get notices.** Read it every minute: it carries everything a webhook would, `listing.removed` among them, and it needs nothing from your side but the secret key. A webhook endpoint needs a public `https` address, which a site on `localhost` does not have. Once your site is deployed, register a [webhook endpoint](reference/webhook-endpoints.md) to get the same notices within seconds ([webhooks, step by step](guides/webhooks.md)), and keep reading the list as the way to catch up after an outage. apidata.one never emails your visitors: your site sends its own ([saved searches and alerts](guides/saved-searches-and-alerts.md)). ## Where next - [Building with AI](guides/building-with-ai.md): a prompt to paste into your AI tool, and the patterns it should write. - [Map search](guides/map-search.md) and [autocomplete](guides/autocomplete.md). - [Compliance](guides/compliance.md): what every page with a listing must show. - [An SEO-friendly site](guides/seo.md): pages built on your server, a sitemap, prompt removal. ## Going live Swap the `_test_` keys for `_live_` keys. Nothing else changes. [Going live](guides/going-live.md) says how an account gets its live keys.