# Quickstart

A key, one curl, and X-Credits-Charged on the response — about five minutes.

## 1. Sign in and create a key

[Sign in](https://directrate.dev/login) with a magic link or Google: no password, no card. Then open [Keys](https://directrate.dev/dashboard/keys) and create your first key. The plaintext is shown **once** — copy it then. The Free plan gives the account 250 credits a month, reset monthly.

## 2. Shop one hotel

Every rate endpoint is a `POST` with a JSON body and the key in `x-api-key`. Put the key in the environment once — every sample below reads it from there:

```bash
export DIRECTRATE_API_KEY=<your key>
```

```bash
curl -s https://api.directrate.dev/v1/shop \
  -H "x-api-key: $DIRECTRATE_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "chain": "hyatt",
    "hotel_code": "CHIZP",
    "checkin": "2027-01-09",
    "los": 1
  }'
```

The response is the room × rate-plan matrix for that stay — every plan the chain sells, the member rate as its own rows (`member_only: true`), `lowest.bar` / `lowest.member` and the after-tax twins, `status`, and `source` / `cache_age_sec` so you know how fresh it is. Read the price on the response itself:

```plaintext
X-Credits-Charged: 1
```

## 3. Points, parity, a calendar

Same body, different path. Award nights in points, cents-per-point against the cash rate and the free-night certificates that cover the stay:

```bash
curl -s https://api.directrate.dev/v1/award \
  -H "x-api-key: $DIRECTRATE_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "chain": "marriott",
    "hotel_code": "CHIRL",
    "checkin": "2027-01-09",
    "los": 1
  }'
```

The direct rate beside Booking.com, Expedia, Hotels.com, Trip.com and Agoda:

```bash
curl -s https://api.directrate.dev/v1/parity \
  -H "x-api-key: $DIRECTRATE_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "chain": "choice",
    "hotel_code": "IL263",
    "checkin": "2027-01-09",
    "los": 1
  }'
```

The lowest rate per night over a window:

```bash
curl -s https://api.directrate.dev/v1/calendar \
  -H "x-api-key: $DIRECTRATE_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "chain": "ihg",
    "hotel_code": "CHIMM",
    "start": "2027-01-09",
    "days": 30
  }'
```

## 4. Find hotel codes

Codes are each chain’s own property identifiers (Marriott `CHIRL`, Hyatt `CHIZP`, IHG `CHIMM`, Hilton `CHITDHX`, Choice `IL263`) — not guessable, not shared between chains. Ask for them:

```bash
curl -s "https://api.directrate.dev/v1/hotels?chain=marriott&q=Chicago,%20IL&radius=5" \
  -H "x-api-key: $DIRECTRATE_API_KEY"
```

One credit however many hotels come back (Best Western 5, Wyndham 6).

## 5. Watch the quota

```bash
curl -s https://api.directrate.dev/v1/usage \
  -H "x-api-key: $DIRECTRATE_API_KEY"
```

Free to call, answered even when the quota is spent. Errors, unknown codes and timeouts never bill.

Prefer tools to HTTP? The same key makes every mode a tool for Claude Code, Cursor, VS Code or a Claude.ai connector: the [MCP server](https://directrate.dev/docs/mcp.md).

Next: [Authentication](https://directrate.dev/docs/authentication.md) · [Credits & pricing](https://directrate.dev/docs/credits-and-pricing.md) · [Watches & webhooks](https://directrate.dev/docs/webhooks.md) · [Batch jobs & export](https://directrate.dev/docs/batch-jobs.md) · the [API reference](https://directrate.dev/docs/reference) for every field.

---

This page for people: https://directrate.dev/docs/quickstart
