---
name: socialcrawl-onboarding
description: >
  Onboard an AI agent onto the SocialCrawl unified social data API. Use when
  you need an API key, a first successful call, an MCP connection, the live
  endpoint catalogue, or the machine-readable docs. Does not issue API keys.
---

# SocialCrawl agent onboarding

SocialCrawl is a unified REST API for social, commerce, and research data.
One key (`x-api-key`), one JSON envelope, live catalogue at `/v1/utility/endpoints`.

This file does **not** create an API key. Keys are issued only after a human
signs up. Unauthenticated key minting is intentionally not offered.

## 1. Get a key

1. Ask the user to sign up at https://www.socialcrawl.dev/auth/register (new accounts get 100 free credits, no card).
2. They copy a key from https://www.socialcrawl.dev/dashboard (it starts with `sc_`).
3. Save it for the rest of the session:

```bash
mkdir -p ~/.config/socialcrawl
echo "sc_your_key_here" > ~/.config/socialcrawl/api_key
export SOCIALCRAWL_API_KEY="$(cat ~/.config/socialcrawl/api_key)"
```

Prefer `$SOCIALCRAWL_API_KEY` when it is already set and starts with `sc_`.

No browser? Register as an agent: https://www.socialcrawl.dev/auth.md

## 2. First calls (0 credits)

Verify the key, then fetch the live onboarding payload. Both are free.

```bash
curl -s -H "x-api-key: $SOCIALCRAWL_API_KEY" \
  "https://www.socialcrawl.dev/v1/credits/balance"

curl -s -H "x-api-key: $SOCIALCRAWL_API_KEY" \
  "https://www.socialcrawl.dev/v1/utility/quickstart"
```

`GET /v1/utility/quickstart` returns auth, the envelope, credit tiers, errors, pagination, and a copy-paste first request. Prefer it over any cached count of platforms or endpoints.

## 3. Connect through MCP

If your client supports MCP, connect it so you can call tools instead of building requests. The server URL is `https://mcp.socialcrawl.dev/mcp` (Streamable HTTP).

Send the key in a header: `Authorization: Bearer sc_your_key_here`. Signing in through the client instead of using a key works only where the dashboard Connect page (https://www.socialcrawl.dev/dashboard/api/integrations) offers it. Otherwise use the header.

- Claude Code: `claude mcp add --transport http socialcrawl https://mcp.socialcrawl.dev/mcp --header "Authorization: Bearer sc_your_key_here"`. Guide: https://www.socialcrawl.dev/docs/claude-code.md
- Codex: `codex mcp add socialcrawl --url https://mcp.socialcrawl.dev/mcp --bearer-token-env-var SOCIALCRAWL_API_KEY`
- Gemini CLI: `gemini mcp add -s user --transport http --header "Authorization: Bearer sc_your_key_here" socialcrawl https://mcp.socialcrawl.dev/mcp`
- Claude Desktop, Cursor, VS Code, Windsurf: a JSON config block. See https://www.socialcrawl.dev/docs/mcp.md
- ChatGPT and Perplexity connect only by sign-in. Use the REST calls in this file.

Confirm it worked: restart the client and ask it to list SocialCrawl platforms. That runs `socialcrawl_find` with no task and costs 0 credits.

## 4. Machine-readable docs (no key)

- https://www.socialcrawl.dev/llms.txt: index of every docs tab and platform file. Follow each index until you reach pages.
- https://www.socialcrawl.dev/llms-full.txt: full reference
- https://www.socialcrawl.dev/v1/openapi.json: OpenAPI 3.1
- https://www.socialcrawl.dev/docs/ai-agents.md: guide for agent integration

Live truth is always `GET /v1/utility/endpoints` (0 credits). If a cached skill file disagrees with that response, trust the API. Add `.md` to any docs URL for its Markdown.

## 5. Make a paid call

```bash
curl -s -H "x-api-key: $SOCIALCRAWL_API_KEY" \
  "https://www.socialcrawl.dev/v1/tiktok/profile?handle=natgeo"
```

- Most endpoints are GET with query params. Batch, web, and monitor routes use POST, PATCH, or DELETE with a JSON body, so do not assume GET.
- `oneOf` identifier groups (for example `handle` **or** `user_id`) need exactly one member. Sending none returns `400 INVALID_REQUEST` and is not billed.
- Failed upstream calls, not-found resources, and empty lists are refunded. Bad params are never billed.

## 6. Next skill

Once the key works, install the full SocialCrawl skill (`npx skills add socialcrawl/skills`, or read https://www.socialcrawl.dev/skills/socialcrawl/SKILL.md) so platform reference files, costs, and constraints are local. Until then, `GET /v1/utility/endpoint?id=tiktok/profile` (0 credits) explains any one endpoint.

## 7. Buy credits

`GET /v1/credits/balance` returns `recommended_pack` and a `checkout_url`, as does a `402` `INSUFFICIENT_CREDITS` in `error.details`. Show the user `checkout_url`; nothing is charged until they pay. Prices: https://www.socialcrawl.dev/pricing.md
