Make an HTTP request through the browser's network stack
curl --request POST \
--url https://api.onkernel.com/browsers/{id}/curl \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"body": "<string>",
"headers": {},
"method": "GET",
"response_encoding": "utf8",
"timeout_ms": 30000
}
'import requests
url = "https://api.onkernel.com/browsers/{id}/curl"
payload = {
"url": "<string>",
"body": "<string>",
"headers": {},
"method": "GET",
"response_encoding": "utf8",
"timeout_ms": 30000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: '<string>',
body: JSON.stringify('<string>'),
headers: {},
method: 'GET',
response_encoding: 'utf8',
timeout_ms: 30000
})
};
fetch('https://api.onkernel.com/browsers/{id}/curl', 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.onkernel.com/browsers/{id}/curl",
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>',
'body' => '<string>',
'headers' => [
],
'method' => 'GET',
'response_encoding' => 'utf8',
'timeout_ms' => 30000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.onkernel.com/browsers/{id}/curl"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"body\": \"<string>\",\n \"headers\": {},\n \"method\": \"GET\",\n \"response_encoding\": \"utf8\",\n \"timeout_ms\": 30000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.onkernel.com/browsers/{id}/curl")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"body\": \"<string>\",\n \"headers\": {},\n \"method\": \"GET\",\n \"response_encoding\": \"utf8\",\n \"timeout_ms\": 30000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onkernel.com/browsers/{id}/curl")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"body\": \"<string>\",\n \"headers\": {},\n \"method\": \"GET\",\n \"response_encoding\": \"utf8\",\n \"timeout_ms\": 30000\n}"
response = http.request(request)
puts response.read_body{
"body": "<string>",
"duration_ms": 123,
"headers": {},
"status": 123
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}{
"message": "<string>",
"net_error": 123,
"net_error_name": "<string>"
}Browsers
Make an HTTP request through the browser's network stack
Sends an HTTP request through Chrome’s HTTP request stack, inheriting the browser’s TLS fingerprint, cookies, proxy configuration, and headers. Returns a structured JSON response with status, headers, body, and timing.
POST
/
browsers
/
{id}
/
curl
Make an HTTP request through the browser's network stack
curl --request POST \
--url https://api.onkernel.com/browsers/{id}/curl \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"body": "<string>",
"headers": {},
"method": "GET",
"response_encoding": "utf8",
"timeout_ms": 30000
}
'import requests
url = "https://api.onkernel.com/browsers/{id}/curl"
payload = {
"url": "<string>",
"body": "<string>",
"headers": {},
"method": "GET",
"response_encoding": "utf8",
"timeout_ms": 30000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: '<string>',
body: JSON.stringify('<string>'),
headers: {},
method: 'GET',
response_encoding: 'utf8',
timeout_ms: 30000
})
};
fetch('https://api.onkernel.com/browsers/{id}/curl', 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.onkernel.com/browsers/{id}/curl",
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>',
'body' => '<string>',
'headers' => [
],
'method' => 'GET',
'response_encoding' => 'utf8',
'timeout_ms' => 30000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.onkernel.com/browsers/{id}/curl"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"body\": \"<string>\",\n \"headers\": {},\n \"method\": \"GET\",\n \"response_encoding\": \"utf8\",\n \"timeout_ms\": 30000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.onkernel.com/browsers/{id}/curl")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"body\": \"<string>\",\n \"headers\": {},\n \"method\": \"GET\",\n \"response_encoding\": \"utf8\",\n \"timeout_ms\": 30000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onkernel.com/browsers/{id}/curl")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"body\": \"<string>\",\n \"headers\": {},\n \"method\": \"GET\",\n \"response_encoding\": \"utf8\",\n \"timeout_ms\": 30000\n}"
response = http.request(request)
puts response.read_body{
"body": "<string>",
"duration_ms": 123,
"headers": {},
"status": 123
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}{
"message": "<string>",
"net_error": 123,
"net_error_name": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Browser session ID
Body
application/json
Request to make an HTTP request through the browser's network stack.
Target URL (must be http or https).
Request body (for POST/PUT/PATCH).
Custom headers merged with browser defaults.
Show child attributes
Show child attributes
HTTP method.
Available options:
GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS Encoding for the response body. Use base64 for binary content.
Available options:
utf8, base64 Request timeout in milliseconds.
Required range:
1000 <= x <= 60000Response
Response from target URL
Structured response from the browser curl request.
⌘I