Get Content
curl --request POST \
--url https://api.example.com/browser/sessions/{id}/content \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"format": "<string>",
"proxyUrl": "<string>",
"headers": {}
}
'import requests
url = "https://api.example.com/browser/sessions/{id}/content"
payload = {
"url": "<string>",
"format": "<string>",
"proxyUrl": "<string>",
"headers": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', format: '<string>', proxyUrl: '<string>', headers: {}})
};
fetch('https://api.example.com/browser/sessions/{id}/content', 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.example.com/browser/sessions/{id}/content",
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' => '<string>',
'format' => '<string>',
'proxyUrl' => '<string>',
'headers' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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.example.com/browser/sessions/{id}/content"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"format\": \"<string>\",\n \"proxyUrl\": \"<string>\",\n \"headers\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/browser/sessions/{id}/content")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"format\": \"<string>\",\n \"proxyUrl\": \"<string>\",\n \"headers\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/browser/sessions/{id}/content")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"format\": \"<string>\",\n \"proxyUrl\": \"<string>\",\n \"headers\": {}\n}"
response = http.request(request)
puts response.read_body{
"url": "<string>",
"content": "<string>",
"format": "<string>"
}Tools
Get Content
Fetch the current page content as HTML, Markdown, or plain text.
POST
/
browser
/
sessions
/
{id}
/
content
Get Content
curl --request POST \
--url https://api.example.com/browser/sessions/{id}/content \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"format": "<string>",
"proxyUrl": "<string>",
"headers": {}
}
'import requests
url = "https://api.example.com/browser/sessions/{id}/content"
payload = {
"url": "<string>",
"format": "<string>",
"proxyUrl": "<string>",
"headers": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', format: '<string>', proxyUrl: '<string>', headers: {}})
};
fetch('https://api.example.com/browser/sessions/{id}/content', 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.example.com/browser/sessions/{id}/content",
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' => '<string>',
'format' => '<string>',
'proxyUrl' => '<string>',
'headers' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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.example.com/browser/sessions/{id}/content"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"format\": \"<string>\",\n \"proxyUrl\": \"<string>\",\n \"headers\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/browser/sessions/{id}/content")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"format\": \"<string>\",\n \"proxyUrl\": \"<string>\",\n \"headers\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/browser/sessions/{id}/content")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"format\": \"<string>\",\n \"proxyUrl\": \"<string>\",\n \"headers\": {}\n}"
response = http.request(request)
puts response.read_body{
"url": "<string>",
"content": "<string>",
"format": "<string>"
}Overview
Returns the content of the session’s active page. Ifurl is supplied, the session navigates there first. The response format can be raw HTML, cleaned Markdown, or plain text.
Path Parameters
string
required
Browser session ID (UUID).
Body
string
Optional URL to navigate to before capturing content. If omitted, captures whatever is currently loaded in the active tab.
string
default:"html"
Output format. One of
html, markdown, text.string
Optional per-request proxy override.
object
Extra request headers applied when
url is set.Example Request
curl -X POST "https://api.scrapengine.io/api/v1/browser/sessions/baa3f390-fa6e-4a24-b84a-a575a5f3a9c7/content" \
-H "Authorization: Bearer $SCRAPENGINE_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "format": "markdown" }'
curl -X POST "https://api.scrapengine.io/api/v1/browser/sessions/baa3f390-fa6e-4a24-b84a-a575a5f3a9c7/content" \
-H "Authorization: Bearer $SCRAPENGINE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"format": "text"
}'
Response
Success Response (200)
string
Effective URL of the captured page (after any redirects).
string
Page content in the requested format.
string
Echoed format — one of
html, markdown, text.{
"url": "https://example.com/",
"content": "# Example Domain\n\nThis domain is for use in illustrative examples...",
"format": "markdown"
}
Error Responses
| Status | Description |
|---|---|
400 | Invalid body — unknown format or malformed url. |
401 | Unauthorized — invalid or missing API key. |
404 | Session not found or not owned by the caller. |
503 | The browser session is temporarily unreachable. |
Was this page helpful?
⌘I