# Quickstart

> Make your first hoshime API call in under a minute, read the response envelope and handle errors.

hoshime is one HTTP API for public web data and the services around it. Every public data endpoint is a `GET` with query parameters, answers with the same `{data, meta}` envelope, and bills only when the source answers.

## 1. Get a token

[Create an account](/signup) and copy the API key from your dashboard. Calls authenticate with it as a bearer token that starts with `hsk_`. Public data needs a token with the `social:read` scope. See [Authentication](/docs/authentication) for scopes, expiry, IP allowlists and rate limits.

```bash
export HOSHIME_TOKEN="hsk_…"
```

## 2. Call an endpoint

Every endpoint lives at `/v1/<platform>/<endpoint>`. This one reads a YouTube video:

```bash
curl "https://api.hoshime.com/v1/youtube/video?id=dQw4w9WgXcQ" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
```

```json
{
  "data": {
    "id": "dQw4w9WgXcQ",
    "title": "Rick Astley - Never Gonna Give You Up (Official Video)",
    "author": { "id": "UCuAXFkgsw1L7xaCfnd5JJOw", "name": "Rick Astley" },
    "viewCount": 1712004113
  },
  "meta": {
    "requestId": "req_2Xb9kQ…",
    "platform": "youtube",
    "endpoint": "video",
    "cached": false,
    "fetchedAt": "2026-11-06T09:41:00Z",
    "units": 1
  }
}
```

`data` is the item, or an array of items for a list endpoint. `meta` says what the call was and what it billed.

## 3. Use it from code

```js
const res = await fetch("https://api.hoshime.com/v1/tiktok/user?username=tiktok", {
  headers: { Authorization: `Bearer ${process.env.HOSHIME_TOKEN}` },
});
if (!res.ok) {
  const problem = await res.json(); // RFC 9457: branch on problem.code
  throw new Error(`${problem.code}: ${problem.detail}`);
}
const { data, meta } = await res.json();
```

```python
import os, requests

res = requests.get(
    "https://api.hoshime.com/v1/binance/ticker",
    params={"symbol": "BTCUSDT"},
    headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"},
)
res.raise_for_status()
ticker = res.json()["data"]
```

## 4. Find the endpoint you need

- Browse the [API catalog](/apis), grouped by category.
- Press <kbd>⌘K</kbd> (<kbd>Ctrl K</kbd> on Windows and Linux) anywhere on this site to search every endpoint.
- Read the machine-readable [OpenAPI 3.1 document](https://api.hoshime.com/openapi.json), generated from the code that serves the API.
- Connect an AI agent through the [MCP server](/docs/mcp).

## What to read next

- [Response format](/docs/responses): the envelope and the field naming rules.
- [Errors](/docs/errors): problem details and which errors to retry.
- [Pagination](/docs/pagination): cursors and `limit`.
- [Billing and caching](/docs/billing): units, free failures and cached answers.