Map, Search & Extract
Discover URLs, search the web, and extract structured data with AI.
Map, Search & Extract
Three powerful operations beyond basic scraping. All return results immediately (no polling needed).
Map a Site
Discover all URLs on a website without scraping their content. Useful for finding pages before crawling.
curl -X POST https://scrapeforllm.com/api/app/scrapes \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"url": "https://docs.example.com",
"type": "map"
}'const response = await fetch("https://scrapeforllm.com/api/app/scrapes", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer YOUR_API_KEY",
},
body: JSON.stringify({
url: "https://docs.example.com",
type: "map",
}),
});
const data = await response.json();
console.log(data.scrape.result.links);import requests
response = requests.post(
"https://scrapeforllm.com/api/app/scrapes",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY",
},
json={
"url": "https://docs.example.com",
"type": "map",
},
)
data = response.json()
print(data["scrape"]["result"]["links"])Response:
{
"scrape": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"status": "completed",
"creditsUsed": 1,
"result": {
"links": [
"https://docs.example.com",
"https://docs.example.com/getting-started",
"https://docs.example.com/api-reference",
"https://docs.example.com/guides/auth"
]
}
}
}Cost: 1 credit.
Search the Web
Search the web for a query and get the results as structured data with page content.
Note
For search, the url field is used as the search query (not a URL).
curl -X POST https://scrapeforllm.com/api/app/scrapes \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"url": "latest Next.js 15 features",
"type": "search"
}'const response = await fetch("https://scrapeforllm.com/api/app/scrapes", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer YOUR_API_KEY",
},
body: JSON.stringify({
url: "latest Next.js 15 features",
type: "search",
}),
});
const data = await response.json();
for (const result of data.scrape.result.data) {
console.log(result.title, result.url);
}import requests
response = requests.post(
"https://scrapeforllm.com/api/app/scrapes",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY",
},
json={
"url": "latest Next.js 15 features",
"type": "search",
},
)
data = response.json()
for result in data["scrape"]["result"]["data"]:
print(result["title"], result["url"])Response:
{
"scrape": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"status": "completed",
"creditsUsed": 2,
"result": {
"data": [
{
"markdown": "# Next.js 15 Release Notes\n\nContent from the page...",
"url": "https://nextjs.org/blog/next-15",
"title": "Next.js 15"
}
]
}
}
}Cost: 2 credits.
Extract Structured Data
Use AI to extract specific information from a page. Returns structured JSON based on your prompt.
curl -X POST https://scrapeforllm.com/api/app/scrapes \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"url": "https://example.com/product",
"type": "extract",
"options": {
"prompt": "Extract the product name, price, rating, and availability"
}
}'const response = await fetch("https://scrapeforllm.com/api/app/scrapes", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer YOUR_API_KEY",
},
body: JSON.stringify({
url: "https://example.com/product",
type: "extract",
options: {
prompt: "Extract the product name, price, rating, and availability",
},
}),
});
const data = await response.json();
console.log(data.scrape.result.data);import requests
response = requests.post(
"https://scrapeforllm.com/api/app/scrapes",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY",
},
json={
"url": "https://example.com/product",
"type": "extract",
"options": {
"prompt": "Extract the product name, price, rating, and availability"
},
},
)
data = response.json()
print(data["scrape"]["result"]["data"])Response:
{
"scrape": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"status": "completed",
"creditsUsed": 5,
"result": {
"data": {
"product_name": "Wireless Headphones Pro",
"price": "$129.99",
"rating": "4.5/5",
"availability": "In Stock"
}
}
}
}If you don't provide a prompt, a default one is used that extracts the main content and key information.
Cost: 5 credits (uses LLM extraction).
Quick Comparison
| Operation | Input | Returns | Credits | Use Case |
|---|---|---|---|---|
| Map | URL | List of URLs | 1 | Find all pages before crawling |
| Search | Query string | Web results with content | 2 | Research a topic |
| Extract | URL + prompt | Structured JSON | 5 | Pull specific data points |