Skip to main content
POST
/
scrape
Scrape a page
curl --request POST \
  --url https://api.beecrawl.dev/scrape \
  --header 'Content-Type: application/json' \
  --header 'X-Web-Extract-Api-Key: <api-key>' \
  --data '
{
  "url": "https://example.com",
  "formats": [
    "markdown",
    "links"
  ],
  "use_browser": "auto"
}
'
import requests

url = "https://api.beecrawl.dev/scrape"

payload = {
"url": "https://example.com",
"formats": ["markdown", "links"],
"use_browser": "auto"
}
headers = {
"X-Web-Extract-Api-Key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'X-Web-Extract-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://example.com',
formats: ['markdown', 'links'],
use_browser: 'auto'
})
};

fetch('https://api.beecrawl.dev/scrape', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.beecrawl.dev/scrape",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://example.com',
'formats' => [
'markdown',
'links'
],
'use_browser' => 'auto'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Web-Extract-Api-Key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.beecrawl.dev/scrape"

payload := strings.NewReader("{\n \"url\": \"https://example.com\",\n \"formats\": [\n \"markdown\",\n \"links\"\n ],\n \"use_browser\": \"auto\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("X-Web-Extract-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.beecrawl.dev/scrape")
.header("X-Web-Extract-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://example.com\",\n \"formats\": [\n \"markdown\",\n \"links\"\n ],\n \"use_browser\": \"auto\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.beecrawl.dev/scrape")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Web-Extract-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://example.com\",\n \"formats\": [\n \"markdown\",\n \"links\"\n ],\n \"use_browser\": \"auto\"\n}"

response = http.request(request)
puts response.read_body
{
  "request_id": "<string>",
  "url": "<string>",
  "final_url": "<string>",
  "markdown": "<string>",
  "metadata": {
    "title": "<string>",
    "language": "<string>",
    "status_code": 123,
    "provider": "<string>",
    "rendered": true,
    "elapsed_ms": 123
  },
  "html": "<string>",
  "rawHtml": "<string>",
  "links": [
    "<string>"
  ],
  "screenshot": "<string>"
}
{}
{}

Authorizations

X-Web-Extract-Api-Key
string
header
required

API key. X-Api-Key and Bearer authentication are also accepted.

Body

application/json
url
string<uri>
required
formats
enum<string>[]
Available options:
markdown,
html,
rawHtml,
links,
screenshot
location
object
timeout_seconds
integer
default:30
Required range: x >= 1
wait_for_ms
integer
default:0
Required range: x >= 0
use_browser
enum<string>
default:auto
Available options:
never,
auto,
always

Response

Scraped page.

request_id
string
required
url
string<uri>
required
final_url
string<uri>
required
markdown
string
required
metadata
object
required
html
string
rawHtml
string
screenshot
string

PNG data URL when requested.