Skip to main content
Getting started

Your first scraping API call in five minutes

Run a page in the Playground first, then send the same request to https://scraping-api.datafuel.ai/api/v1/task with the key from Scraping API → Settings. Both return the page as Markdown.

Written By Carmine Cella

Last updated 1 day ago

Run a page in the Playground first, then send the same request to https://scraping-api.datafuel.ai/api/v1/task with the key from Scraping API → Settings. Both return the page as Markdown.

Before you start

  • The scraping API activated on your account: the free plan is enough.
  • A terminal with curl, or any HTTP client.

Steps

  1. Open Scraping API → Playground. Unlocker is the first tool tab; LLM Scraper, Search, Map and Crawl sit next to it.
  2. Paste a URL, keep Format: Markdown, and click Start extraction. The run appears under Recent runs as Completed, with chips for the execution type, the network (Basic), the format, the time and the credits used. Preview shows the page; Raw, JSON and Response show what the API returns.
  3. Open Scraping API → Settings. Under API key, click the eye icon to reveal your key (it starts with df_key_) and copy it. The same panel shows the base URL https://scraping-api.datafuel.ai/api/v1 and your concurrency limit.
  4. Run the same request from your terminal:
curl https://scraping-api.datafuel.ai/api/v1/task \
     --header 'X-API-Key: df_key_YOUR_KEY' \
     --header 'Content-Type: application/json' \
     --data '{ "type": "unlocker", "url": "https://example.com", "proxy_type": "Basic", "result_format": "markdown" }'
  1. Read result.data in the answer: that is the page. credits_used tells you what it cost; blocked: true means the target refused and nothing was charged.
  2. For a protected site, run the same call with "proxy_type": "Premium" (residential network, 10 credits).
Steps 1 and 2: the Unlocker tab, the URL field with Start extraction, and a completed run with its credits and result tabs
Step 3: the API key field with the eye icon, and the base URL under it

What happens next

/task waits for the page, so set your client timeout to at least 120 seconds. JS render in the Playground adds browser rendering for pages built with JavaScript (4 credits more on top of the base price). For lists of URLs use Batch in the Playground or /job in the API; for whole sites use Crawl. History keeps every run; Analytics shows credits, success rate and cost per domain.

If it did not work

  • 401. The key is missing or wrong; copy it again from Scraping API → Settings. The scraping key is not the dashboard key (df_live_…) from Settings → API Keys.
  • 403. The account is deactivated or the key was rotated; check the Settings page.
  • Credits charged but the result is empty. Credits are reserved when a task is queued and returned when it fails; refresh the counter after a minute.