> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stophy.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Make your first Stophy call with no key, then add a key and make the same call from TypeScript, Python, cURL, or the CLI.

## 1. Try it with no key

YouTube search works without a key, within a small free limit.

```bash theme={null}
curl -X POST https://api.stophy.dev/v1/youtube/search \
  -H "content-type: application/json" \
  -d '{"query":"rust tutorial"}'
```

You should see JSON like this, with `creditsUsed` at `0`:

```json theme={null}
{
  "success": true,
  "data": {
    "results": [
      {
        "type": "video",
        "id": "Wc0ZJo06oAw",
        "url": "https://www.youtube.com/watch?v=Wc0ZJo06oAw",
        "title": "The Ultimate Rust Beginners Guide (2026)",
        "channel": {
          "id": "UCt6XPuD8u3YjvybuT-Xnj5A",
          "username": "SBJake",
          "name": "SBJake",
          "url": "https://www.youtube.com/channel/UCt6XPuD8u3YjvybuT-Xnj5A"
        },
        "durationSeconds": 422,
        "views": 543208,
        "thumbnail": "https://i.ytimg.com/vi/Wc0ZJo06oAw/hqdefault.jpg",
        "isShort": false,
        "isLive": false,
        "createdAt": "2025-09-28T13:19:10.000Z"
      }
    ]
  },
  "creditsUsed": 0,
  "requestId": "5fb0898a-3983-4f30-ae3e-3146c406ccd1"
}
```

## 2. Get an API key

Sign up at [stophy.dev/signup](https://stophy.dev/signup). New accounts start with 500 free credits. Create a key and store it as `STOPHY_API_KEY`. Never put it in code.

## 3. Make the same call with a key

Send the key as a bearer token. This is the same call as step 1, now under your account.

<CodeGroup>
  ```typescript TypeScript icon="https://mintcdn.com/sirathic/7E4w9-IC4ysabjfc/images/icons/typescript.svg?fit=max&auto=format&n=7E4w9-IC4ysabjfc&q=85&s=d8272a85e64145620f1fbbfcf7932986" theme={null}
  import { Stophy } from "stophy";

  const stophy = new Stophy({ apiKey: process.env.STOPHY_API_KEY });
  const result = await stophy.youtube.search({ query: "rust tutorial" });
  console.log(result.data.results);
  ```

  ```python Python icon="python" theme={null}
  from stophy import Stophy

  stophy = Stophy()  # reads STOPHY_API_KEY
  result = stophy.youtube.search(query="rust tutorial")
  print(result["data"]["results"])
  ```

  ```bash cURL icon="terminal" theme={null}
  curl -X POST https://api.stophy.dev/v1/youtube/search \
    -H "Authorization: Bearer $STOPHY_API_KEY" \
    -H "content-type: application/json" \
    -d '{"query":"rust tutorial"}'
  ```

  ```bash CLI icon="square-terminal" theme={null}
  stophy youtube search "rust tutorial"
  ```
</CodeGroup>

It returns the same shape as before. With a key, it costs 1 credit per 20 items, at least 1 credit, instead of being free.

## Next steps

<CardGroup cols={2}>
  <Card title="Find the right endpoint" icon="magnifying-glass" href="/guides/find-endpoint">
    Search the catalog for the data you need.
  </Card>

  <Card title="Connect over MCP" icon="plug" href="/mcp-server">
    Let your coding agent call Stophy.
  </Card>
</CardGroup>
