# Quickstart

This page takes you from a new account to a working API call. You need a terminal with `curl`. To try the SDK at the end, you also need Node.js.

## 1. Create a free account

Create your account on the [signup page](/signup) with Google, GitHub or a sign-in link sent to your email address. Every account starts on the Free plan: 100 credits every month, and no card. Free plan credits do not roll over to the next month.

Each call costs credits: 1 for a basic phone check, 3 for a live phone lookup, 1 for an email verification and 1 for an IP lookup. Errors are never billed. [Credits](/docs/credits) has the details.

## 2. Copy an API key

The dashboard gives you two kinds of keys:

| Key | Prefix | What you get | Credits |
|---|---|---|---|
| Test | `sk_test_` | Simulated, deterministic responses | Never debited |
| Live | `sk_live_` | Real checks | Debited per call |

Use a live key for this guide so you see real data; your free credits cover it. A live key is shown once, when you create it. Copy it straight into your password manager or secret store: we keep only a SHA-256 hash of it and cannot display it again.

Put the key in an environment variable so the examples below can read it and it stays out of your code:

```bash
export API_KEY="sk_live_your_key"
```

## 3. Make your first call

Validate a phone number:

```bash
curl https://api.qelka.com/v1/phone \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"phone": "+14155550123"}'
```

The response is a `phone` object:

```json
{
  "id": "lkp_01M84BPVKXRNA90357Q2RGMZV0",
  "object": "phone",
  "input": "+14155550123",
  "valid": true,
  "status": "valid",
  "e164": "+14155550123",
  "national": "(415) 555-0123",
  "country": { "code": "US", "name": "United States", "calling_code": "1" },
  "region": "California",
  "timezones": ["America/Los_Angeles"],
  "line_type": "fixed_line_or_mobile",
  "carrier": { "name": null, "mcc": null, "mnc": null, "source": "numbering_plan" },
  "ported": null,
  "credits_used": 1,
  "cached": false
}
```

What it tells you:

- `valid` and `status`: the number fits the North American numbering plan.
- `e164`: the canonical form to store. [Format phone numbers in E.164](/docs/guides/format-phone-numbers-e164) explains why.
- `line_type` is `fixed_line_or_mobile` because the North American numbering plan does not separate mobile numbers from landlines.
- `carrier.source` is `numbering_plan`: at the basic level the carrier comes from the numbering plan data, which has no carrier for this range, so `name` is null. The live level (`"level": "live"`) asks the network for the current carrier and porting status instead.
- `credits_used`: what this call cost.

With a test key, phone numbers are still parsed for real, and nothing is debited from your balance.

## 4. Read the headers

Add `-i` to the same command to see the response headers:

```http
HTTP/1.1 200 OK
Content-Type: application/json
X-RateLimit-Limit: 200
X-RateLimit-Remaining: 199
X-RateLimit-Reset: 1795442534
X-Credits-Remaining: 99
X-Request-Id: req_01M84BDPNRG2T1PXRRQV5JT1YA
```

`X-Credits-Remaining` is your balance after the call. Keep `X-Request-Id` when something looks wrong: it is the first thing support asks for. [Rate limits](/docs/rate-limits) explains the other three headers.

## 5. Verify an email and look up an IP

Replace the address with one of your own:

```bash
curl https://api.qelka.com/v1/email \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email": "you@yourcompany.com"}'
```

```bash
curl https://api.qelka.com/v1/ip \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ip": "8.8.8.8"}'
```

Read `status` and `reason` in the email result, and `asn`, `flags` and `risk` in the IP result. The [email](/docs/api-reference/email) and [IP](/docs/api-reference/ip) reference pages describe every field.

An email check in the default `full` mode waits for the recipient's mail server to answer, so it can take a few seconds. Send `"mode": "fast"` to skip the mailbox check and get an answer right away.

## 6. Use the JavaScript SDK

Install the package:

```bash
npm install @qelka/sdk
```

Save this as `check.mjs`:

```javascript
import { Client } from '@qelka/sdk'

const client = new Client({ apiKey: process.env.API_KEY })

const phone = await client.phone.validate({ phone: '+14155550123' })
console.log(phone.status, phone.e164, phone.line_type)

const email = await client.email.verify({ email: 'you@yourcompany.com' })
console.log(email.status, email.reason)

const ip = await client.ip.lookup({ ip: '8.8.8.8' })
console.log(ip.asn?.org, ip.risk.level)
```

Run it with `node check.mjs`. The SDK throws an `ApiError` when a call fails and retries rate-limited calls on its own. [JavaScript SDK](/docs/sdk-js) covers the rest.

## If something goes wrong

| You get | It means | What to do |
|---|---|---|
| 401 `invalid_api_key` | The key is missing, mistyped or revoked | Send the header as `Authorization: Bearer sk_live_...` and check the key prefix in the dashboard |
| 400 `invalid_request` | The body is not valid JSON, a field is missing, or a field is not part of the endpoint | Send `Content-Type: application/json` and only the fields listed in the reference |
| 402 `insufficient_credits` | Your balance cannot cover the call | Switch to a test key while you build, or add credits on the [pricing page](/pricing) |
| 429 `rate_limited` | Too many requests in the current window | Wait the number of seconds in `Retry-After` |

Every error type has its own section in [Errors](/docs/errors).

## Next steps

- Keep your keys safe: [Authentication](/docs/authentication).
- Run your test suite without spending credits: [Test mode](/docs/test-mode).
- Check email, phone and IP of each new user in one call: [Validate signup forms](/docs/guides/validate-signup-forms).
- Check a whole file: [Bulk jobs](/docs/api-reference/bulk).
