crawlapi handles JavaScript rendering, document parsing, and protected pages behind one API endpoint so your app or coding agent gets clean data from any URL.
Start with a single HTTP request, connect your coding agent through MCP, or read pages from your terminal with the CLI.
POST /v1/scrape request.Make a request
Set CRAWLAPI_API_KEY in your environment (see Quickstart), then send a JSON body with url to POST https://api.crawlapi.dev/v1/scrape:
curl -sS https://api.crawlapi.dev/v1/scrape \
-H "Authorization: Bearer $CRAWLAPI_API_KEY" \
-H 'content-type: application/json' \
--data '{"url": "https://example.com"}'const response = await fetch('https://api.crawlapi.dev/v1/scrape', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.CRAWLAPI_API_KEY}`,
'content-type': 'application/json',
},
body: JSON.stringify({ url: 'https://example.com' }),
});
const body = await response.json();
if (!body.success) throw new Error(`${body.error.code}: ${body.error.message}`);
console.log(body.data.markdown);import os
import requests
response = requests.post(
"https://api.crawlapi.dev/v1/scrape",
headers={"Authorization": f"Bearer {os.environ['CRAWLAPI_API_KEY']}"},
json={"url": "https://example.com"},
timeout=65,
)
body = response.json()
if not body["success"]:
raise RuntimeError(f"{body['error']['code']}: {body['error']['message']}")
print(body["data"]["markdown"])package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"os"
"time"
)
func main() {
payload := []byte(`{"url":"https://example.com"}`)
req, err := http.NewRequest("POST", "https://api.crawlapi.dev/v1/scrape", bytes.NewReader(payload))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CRAWLAPI_API_KEY"))
req.Header.Set("Content-Type", "application/json")
client := &http.Client{Timeout: 65 * time.Second}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var body struct {
Success bool `json:"success"`
Data struct{ Markdown string `json:"markdown"` } `json:"data"`
Error struct{ Code, Message string } `json:"error"`
}
if err := json.NewDecoder(resp.Body).Decode(&body); err != nil {
panic(err)
}
if !body.Success {
panic(fmt.Sprintf("%s: %s", body.Error.Code, body.Error.Message))
}
fmt.Println(body.Data.Markdown)
}require "json"
require "net/http"
require "uri"
uri = URI("https://api.crawlapi.dev/v1/scrape")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV.fetch('CRAWLAPI_API_KEY')}"
req["Content-Type"] = "application/json"
req.body = JSON.generate({ url: "https://example.com" })
res = Net::HTTP.start(
uri.host, uri.port, use_ssl: true, read_timeout: 65
) { |http| http.request(req) }
body = JSON.parse(res.body)
raise "#{body.dig("error", "code")}: #{body.dig("error", "message")}" unless body["success"]
puts body.dig("data", "markdown")<?php
$ch = curl_init('https://api.crawlapi.dev/v1/scrape');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 65,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('CRAWLAPI_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode(['url' => 'https://example.com']),
]);
$raw = curl_exec($ch);
if ($raw === false) throw new RuntimeException(curl_error($ch));
$body = json_decode($raw, true, 512, JSON_THROW_ON_ERROR);
if (empty($body['success']))
throw new RuntimeException($body['error']['code'] . ': ' . $body['error']['message']);
echo $body['data']['markdown'];The cleaned page text is in data.markdown, unique page links in data.links, and page details in data.metadata.
Output formats
| Format | Response field | What you get |
|---|---|---|
markdown (default) |
data.markdown |
Clean page text, headings, lists, code blocks, and Markdown tables, plus data.links |
json |
data.json |
Normalized structured entity, tables, raw jsonld, and embedded page state |
Built-in page handling
- JavaScript rendering: Dynamic apps and single-page sites render before extraction so you get the live page content, not an empty shell.
- Protected pages: Difficult sites are handled automatically with no extra flags, proxy setup, or browser configuration on your side.
- Documents: PDF, Office, OpenDocument, EPUB, RTF, CSV, JSON, RSS/Atom feeds, and plain text convert through the same endpoint.
- X and YouTube: X posts and YouTube videos return dedicated markdown layouts and structured fields.
- Structured errors: Every failure returns a machine-readable
error.code, aretryableboolean, and a link to its remedy.
Choose how to use crawlapi
| You have | You want | Use |
|---|---|---|
| A web page URL | Clean markdown for LLMs, RAG, or search | Markdown |
| A product, article, listing, or entity URL | Normalized fields, tables, JSON-LD, or embedded state | Structured JSON |
| A PDF, Office file, CSV, JSON, or feed URL | Extracted text, tables, or feed links | PDFs & documents |
| An X post or YouTube URL | Thread, replies, chapters, or transcript | X & YouTube |
| A list of URLs or a site to crawl | Local files, resumable batches, or shell piping | CLI |
| A coding agent (Claude Code, Codex, Cursor, VS Code) | Live web-reading tools inside chat | MCP server |
| A codebase with an AI coding agent | Accurate API usage without live MCP tools | Agent skill |
Use crawlapi from an agent
The Agent quickstart gives your coding agent one prompt to wire crawlapi into your project, connect MCP, install the CLI, or add the skill. To set up one piece directly, connect the hosted MCP server, configure Use crawlapi as default, install the Agent skill, or use the crawl CLI in scripts.
Before you ship
Call POST https://api.crawlapi.dev/v1/scrape from any language with standard HTTPS — no SDK required. Before launching, review Timeouts, Rate limits, and Errors and retries for production resilience, and see Credits and pricing for request billing.
Reading pages
Account and operations
RateLimit headers, and 429 handling.