API Documentation

Integrate Extractly into your applications

Need an API key to get started?

Create and manage your keys from the API Keys page.

Go to API Keys

Quick Start

Get up and running in minutes

Extractly provides a simple REST API to scrape websites and extract structured data using AI. The typical workflow is:

  1. 1
    Scrape - Fetch content from a website URL
  2. 2
    Extract - Send scraped content to AI with your extraction prompt
  3. 3
    Use - Receive structured JSON data for your application

Base URL

text
https://extractly.me/api

Authentication

text
Authorization: Bearer YOUR_API_KEY

Endpoints

Complete Example

Full workflow: scrape then extract

Step 1: Scrape the website

javascript
const scrapeResponse = await fetch('/api/scrape', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_API_KEY'
  },
  body: JSON.stringify({
    url: 'https://example-spa.com',
    maxPages: 5,
    mode: 'optimized'
  })
});

const scrapeData = await scrapeResponse.json();
console.log(`Scraped ${scrapeData.pagesScraped} pages`);

Step 2: Extract structured data

javascript
const extractResponse = await fetch('/api/extract', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_API_KEY'
  },
  body: JSON.stringify({
    scrapedData: scrapeData.scrapedData,
    templatePrompt: `
      Extract all services from this spa website.
      Return JSON: {
        business: { name, phone, email, address },
        services: [{ name, price, duration, description }]
      }
    `,
    provider: 'gemini'
  })
});

const result = await extractResponse.json();
console.log(result.outputJson);

Step 3: Use the extracted data

javascript
// Example output
{
  "business": {
    "name": "Serenity Spa & Wellness",
    "phone": "(555) 123-4567",
    "email": "[email protected]",
    "address": "123 Relaxation Blvd, Wellness City"
  },
  "services": [
    {
      "name": "Deep Tissue Massage",
      "price": "$120",
      "duration": "60 min",
      "description": "Therapeutic massage targeting deep muscle layers"
    },
    {
      "name": "Hot Stone Therapy",
      "price": "$150",
      "duration": "90 min",
      "description": "Relaxing massage with heated basalt stones"
    }
  ]
}

Error Handling

Common error codes and how to handle them

Error CodeHTTP StatusDescriptionSolution
INVALID_JSON400Request body is not valid JSONCheck your JSON syntax
INVALID_URL400The provided URL is malformedEnsure URL starts with http:// or https://
SCRAPE_FAILED422Could not scrape the websiteSite may be blocking scrapers or down
EXTRACTION_FAILED422AI could not extract dataRefine your prompt or check scraped content
NETWORK_ERROR502Backend service unavailableRetry in a few seconds
RATE_LIMITED429Too many requestsWait before retrying

Ready to start building?

Try the interactive playground to test extractions before integrating.