Skip to main content

Get your API key

First, you’ll need your API key. You can find it in the FetchFox app at https://fetchfox.ai/settings/api-keys.

Run a scrape

To run a scrape, use the /api/scrape endpoint with:
  • pattern for URL matching
  • template for the output shape
curl -X POST https://api.fetchfox.ai/api/scrape \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
  "pattern": "https://pokemondb.net/pokedex/*",
  "template": {
    "name": "Pokemon name",
    "number": "Pokemon number"
  },
  "maxVisits": 10,
  "maxExtracts": 10
}'
import fetch from 'node-fetch';

const response = await fetch('https://api.fetchfox.ai/api/scrape', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_API_KEY',
  },
  body: JSON.stringify({
    pattern: 'https://pokemondb.net/pokedex/*',
    template: {
      name: 'Pokemon name',
      number: 'Pokemon number'
    },
    maxVisits: 10,
    maxExtracts: 10
  })
});

const data = await response.json();
console.log(data.results.items);
import requests

url = "https://api.fetchfox.ai/api/scrape"
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer YOUR_API_KEY"
}
data = {
    "pattern": "https://pokemondb.net/pokedex/*",
    "template": {
        "name": "Pokemon name",
        "number": "Pokemon number"
    },
    "maxVisits": 10,
    "maxExtracts": 10
}

response = requests.post(url, json=data, headers=headers)
print(response.json()['results']['items'])
When the scrape finishes, the extracted items are in results.items.

Next Steps

Now that you’ve run a simple scrape:
  1. Learn how crawl and extract work together.
  2. Learn how to control crawl scope and cost.