# Introduction

A REST API for screenshots, scraping, and page-change monitoring — one key, one base URL, every output.

## What ByteKit is

ByteKit is a REST API for capturing what a webpage looks like and what it says —
screenshots, raw HTML or clean markdown, and page-change monitoring.
One API key, one base URL, every output you'd otherwise stitch together from a headless-browser
farm and a scraping proxy.

## Integrate in 60 seconds

- **Base URL:** `https://api.bytekit.com`
- **Auth:** send `Authorization: Bearer $BYTEKIT_API_KEY` on every request. Create a key in the
  [ByteKit dashboard](https://app.bytekit.com) and export it as `BYTEKIT_API_KEY`.
- **Install:** `npm install @hunt-labs/bytekit-sdk` for TypeScript, or `pip install bytekit-sdk`
  for Python (import name `bytekit`).
- **Try it without paying:** a new pay-as-you-go account receives a one-time starter grant of
  **100 MB of bandwidth and 100 credits**, issued once per account and not a purchase. It does not
  expire, and real requests draw it down. Details on the
  [balance page](https://bytekit.com/docs/billing/balance#starter-grant).

The npm package is `@hunt-labs/bytekit-sdk` — not `bytekit`, which is an unrelated package.

The first call with curl is in the [Quickstart](https://bytekit.com/docs/quickstart). With the TypeScript SDK:

```ts
import { ByteKit } from '@hunt-labs/bytekit-sdk';

const client = new ByteKit({ apiKey: process.env.BYTEKIT_API_KEY! });
const result = await client.scrape.create({ url: 'https://example.com', formats: ['markdown'] });
if (result.status === 'success') {
  console.log(result.metadata.title);
  console.log(result.formats.markdown);
} else {
  console.log(result); // the queued receipt; a failed scrape throws ByteKitError instead
}
```

The same call with the Python SDK:

```python
import os

from bytekit import ByteKit
from bytekit.models import ScrapeSuccessEnvelope

client = ByteKit(api_key=os.environ["BYTEKIT_API_KEY"])
result = client.scrape.create(url="https://example.com", formats=["markdown"])
if isinstance(result, ScrapeSuccessEnvelope):
    print(result.metadata.title)
    print(result.formats.markdown)
else:
    print(result)  # the queued receipt; a non-2xx response or a failed scrape raises ByteKitError
```

Full SDK guides: [TypeScript](https://bytekit.com/docs/libraries/typescript) and [Python](https://bytekit.com/docs/libraries/python).

## What you can do with it

- **Scrape** — Fetch a URL as raw HTML, clean markdown, or structured content.
- **Screenshot** — Capture full-page or viewport PNG/JPEG.
- **Monitor** — Watch a URL on a schedule and webhook you when the rendered output changes.
- **Bulk** — Fan out thousands of URLs in parallel and receive one webhook when the job completes.
- **Sitemap** — Discover URLs from a domain's sitemap or by light crawling.
- **[Fetch](https://bytekit.com/docs/api/fetch/postfetch)** — Low-latency raw HTTP fetch: the target's response comes back as the body, with metadata in headers.
- **[Search](https://bytekit.com/docs/api/search/createsearch)** — Run a web search and get ranked organic results.
- **[Schema extraction](https://bytekit.com/docs/api/schema/createschemaextraction)** — Extract structured JSON from a URL against a JSON Schema.

Scrape and screenshot calls can both be made asynchronous: send `"async": true` in the JSON body or
`?async=true` in the query string (either one is enough, on either endpoint). The API then returns
`202` with a `sc_…` (scrape) or `ss_…` (screenshot) ID immediately, which you poll (scrapes can also
deliver via webhook). Without it, screenshots hold up to 28s and return `200`.

## Authentication and accounts

Every request carries a Bearer API key, prefixed `sk_live_`. Manage keys from the [dashboard](https://app.bytekit.com) —
up to 50 active keys per account, with per-key billing attribution so you can split usage
cleanly across services.

Full details in the [Authentication guide](https://bytekit.com/docs/guides/authentication).

## Where to go next

- [Quickstart](https://bytekit.com/docs/quickstart) — first call in under five minutes, no SDK required.
- [Client Libraries](https://bytekit.com/docs/libraries) — official TypeScript and Python SDKs.
- [Scraping](https://bytekit.com/docs/guides/scraping) — formats, options, async polling.
- [Rate Limits](https://bytekit.com/docs/guides/rate-limits) — usage counting, concurrency slots, response headers.
- [Monitors](https://bytekit.com/docs/guides/monitors) — schedule-based change detection with webhooks.
- [API Reference](https://bytekit.com/docs/api) — every endpoint, request, and response.