# Langflow (/docs/integrations/langflow) Pull social media data into Langflow without writing a server. You can call SocialCrawl from a Langflow flow with the API Request component. One GET request returns structured data for the next component. Setup takes three steps: store the key, add the component, read the status. ## Before you start Create an API key in the dashboard under API Keys. Store it as a global variable in Langflow, and reference the variable in the component instead of typing the key into it. Prove the key with a call that costs nothing: ```bash title="Check the key (0 credits)" curl "https://www.socialcrawl.dev/v1/credits/balance" \ -H "x-api-key: sc_your_key_here" ``` A reply with `"success": true` and your balance in `data.balance` means the key works. ## Connect Add an **API Request** component in URL mode and set these fields: | Field | Value | | ---------------- | ------------------------------------------------------------------- | | URL | `https://www.socialcrawl.dev/v1/tiktok/profile` | | Method | `GET` | | Query Parameters | `handle` = `charlidamelio` | | Headers | `x-api-key` = the global variable that holds your key | Turn on **Include HTTPx Metadata** so the output carries the status code next to the body. Change the path and the query to call any other endpoint. ## Read the answer Every response has the same shape. Branch on `success`. A list puts its rows in `data.items`, and `pagination.next_cursor` is the token for the next page. ```json title="Response (trimmed)" { "success": true, "data": { "author": { "username": "charlidamelio" } }, "credits_used": 1, "credits_remaining": 99 } ``` To read the next page, call again with `next_cursor` as the `cursor` query parameter, and stop when `pagination.has_more` is `false`. See [Pagination](/docs/pagination.md). ## When it stops With **Include HTTPx Metadata** on, the output includes `status_code`. Add a condition on it, and send a 402 to a component that outputs the message as text. When credits run out, the answer is a 402 with `error.type` set to `INSUFFICIENT_CREDITS`. Read `error.message` for the text and `error.details.checkout_url` for the link that opens checkout. When the link is absent, `error.details.top_up_url` opens the billing page. Run the flow once with a failing key to see where your version places the body. Never retry a 402, because it fails until credits are added. Retry a 429 after the seconds in the `Retry-After` header, and a 502, 503 or 504 after a short backoff. See [Errors](/docs/errors.md). ## What a run costs It depends on the endpoint, and some endpoints are priced by what they return. [Endpoint pricing](/docs/endpoint-pricing.md) lists each one, and [Credits](/docs/credits.md) explains cache hits and refunds. A flow that runs per chat message calls the API each time. `GET /v1/utility/estimate` quotes a call for 0 credits. - [Errors](/docs/errors.md): Every error code, with the fix and whether to retry. - [Skills & MCP](/docs/skills-and-mcp.md): Give an agent every endpoint as a tool. - [Endpoint pricing](/docs/endpoint-pricing.md): What each endpoint costs before a flow runs it.