Back to Crawl4ai

Turn Any Website Into An API

docs/examples/website-to-api/static/index.html

0.8.61.1 KB
Original Source

Turn Any Website Into An API

This example shows how to turn any website into an API using Crawl4AI.

1. Your Request

URL:

QUERY:

Approach:LLM-based (More Flexible)Schema-based (Uses LLM once!)

Model:Select a Model

Extract Data

2. Your Instant API & Data

API Request (cURL):

curl -X POST http://localhost:8000/scrape -H "Content-Type: application/json" -d '{"url": "...", "query": "..."}'

# Or for LLM-based approach:
curl -X POST http://localhost:8000/scrape-with-llm -H "Content-Type: application/json" -d '{"url": "...", "query": "..."}'

JSON Response:

{
  "success": true,
  "extracted_data": [
    {
      "title": "Example Book",
      "author": "John Doe",
      "description": "A great book..."
    }
  ]
}

Extracted Data

Copy JSON

URL:

Query:

Model Used:

AI is analyzing the website and extracting data...

Model Configuration

Configure and manage your AI model configurations

Add New Model

Model Name:

Provider:

API Token: Save Model

Saved Models

Saved API Requests

View and manage your previous API requests