# Fixed reference example. Playground inputs do not update this sample.
curl --request POST \
--url https://api.aisa.one/apis/v1/dataforseo/on_page/instant_pages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '[
{
"url": "https://dataforseo.com/blog",
"enable_javascript": true,
"custom_js": "meta = {}; meta.url = document.URL; meta;"
}
]'curl --request POST \
--url https://api.aisa.one/apis/v1/dataforseo/on_page/instant_pages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"custom_js": "meta = {}; meta.url = document.URL; meta;",
"enable_javascript": true,
"url": "https://dataforseo.com/blog"
}
]
'import requests
url = "https://api.aisa.one/apis/v1/dataforseo/on_page/instant_pages"
payload = [
{
"custom_js": "meta = {}; meta.url = document.URL; meta;",
"enable_javascript": True,
"url": "https://dataforseo.com/blog"
}
]
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([
{
custom_js: 'meta = {}; meta.url = document.URL; meta;',
enable_javascript: true,
url: 'https://dataforseo.com/blog'
}
])
};
fetch('https://api.aisa.one/apis/v1/dataforseo/on_page/instant_pages', 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.aisa.one/apis/v1/dataforseo/on_page/instant_pages",
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([
[
'custom_js' => 'meta = {}; meta.url = document.URL; meta;',
'enable_javascript' => true,
'url' => 'https://dataforseo.com/blog'
]
]),
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.aisa.one/apis/v1/dataforseo/on_page/instant_pages"
payload := strings.NewReader("[\n {\n \"custom_js\": \"meta = {}; meta.url = document.URL; meta;\",\n \"enable_javascript\": true,\n \"url\": \"https://dataforseo.com/blog\"\n }\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.aisa.one/apis/v1/dataforseo/on_page/instant_pages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"custom_js\": \"meta = {}; meta.url = document.URL; meta;\",\n \"enable_javascript\": true,\n \"url\": \"https://dataforseo.com/blog\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/dataforseo/on_page/instant_pages")
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 {\n \"custom_js\": \"meta = {}; meta.url = document.URL; meta;\",\n \"enable_javascript\": true,\n \"url\": \"https://dataforseo.com/blog\"\n }\n]"
response = http.request(request)
puts response.read_body{
"cost": 123,
"status_code": 123,
"status_message": "<string>",
"tasks_count": 123,
"tasks_error": 123,
"time": "<string>",
"version": "<string>",
"tasks": [
{
"cost": 123,
"data": {},
"id": "<string>",
"path": [
"<string>"
],
"result_count": 123,
"status_code": 123,
"status_message": "<string>",
"time": "<string>",
"result": [
{
"crawl_gateway_address": "<string>",
"crawl_progress": "<string>",
"crawl_status": {},
"items": [
{
"accept_type": "<string>",
"fetch_timing": {
"duration_time": 123,
"fetch_end": 123,
"fetch_start": 123
},
"is_resource": true,
"meta": {
"broken_html": {
"errors": [
{
"column": 123,
"line": 123,
"message": "<string>",
"status_code": 123
}
],
"warnings": [
{
"column": 123,
"line": 123,
"message": "<string>",
"status_code": 123
}
]
},
"canonical": "<string>",
"charset": 123,
"content": {
"automated_readability_index": 123,
"coleman_liau_readability_index": 123,
"dale_chall_readability_index": 123,
"description_to_content_consistency": 123,
"flesch_kincaid_readability_index": 123,
"meta_keywords_to_content_consistency": 123,
"plain_text_rate": 123,
"plain_text_size": 123,
"plain_text_word_count": 123,
"smog_readability_index": 123,
"title_to_content_consistency": 123
},
"cumulative_layout_shift": 123,
"deprecated_tags": [
"<string>"
],
"description": "<string>",
"description_length": 123,
"duplicate_meta_tags": [
"<string>"
],
"external_links_count": 123,
"favicon": "<string>",
"follow": true,
"generator": "<string>",
"htags": {},
"images_count": 123,
"images_size": 123,
"inbound_links_count": 123,
"internal_links_count": 123,
"meta_keywords": "<string>",
"meta_title": "<string>",
"render_blocking_scripts_count": 123,
"render_blocking_stylesheets_count": 123,
"scripts_count": 123,
"scripts_size": 123,
"social_media_tags": {},
"spell": {
"hunspell_language_code": "<string>",
"misspelled": [
{
"word": "<string>"
}
]
},
"stylesheets_count": 123,
"stylesheets_size": 123,
"title": "<string>",
"title_length": 123
},
"cache_control": {
"cachable": true,
"ttl": 123
},
"checks": {},
"content_encoding": "<string>",
"encoded_size": 123,
"fetch_time": "<string>",
"last_modified": {
"header": "<string>",
"meta_tag": "<string>",
"sitemap": "<string>"
},
"location": "<string>",
"media_type": "<string>",
"resource_errors": {
"errors": [
{
"column": 123,
"line": 123,
"message": "<string>",
"status_code": 123
}
],
"warnings": [
{
"column": 123,
"line": 123,
"message": "<string>",
"status_code": 123
}
]
},
"resource_type": "<string>",
"server": "<string>",
"size": 123,
"status_code": 123,
"total_transfer_size": 123,
"url": "<string>",
"broken_links": true,
"broken_resources": true,
"click_depth": 123,
"custom_js_client_exception": "<string>",
"custom_js_response": {},
"duplicate_content": true,
"duplicate_description": true,
"duplicate_title": true,
"onpage_score": 123,
"page_timing": {
"connection_time": 123,
"dom_complete": 123,
"download_time": 123,
"duration_time": 123,
"fetch_end": 123,
"fetch_start": 123,
"first_input_delay": 123,
"largest_contentful_paint": 123,
"request_sent_time": 123,
"time_to_interactive": 123,
"time_to_secure_connection": 123,
"waiting_time": 123
},
"relative_url_length": 123,
"total_dom_size": 123,
"url_length": 123
}
],
"items_count": 123
}
]
}
]
}OnPage API Instant Pages
# Fixed reference example. Playground inputs do not update this sample.
curl --request POST \
--url https://api.aisa.one/apis/v1/dataforseo/on_page/instant_pages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '[
{
"url": "https://dataforseo.com/blog",
"enable_javascript": true,
"custom_js": "meta = {}; meta.url = document.URL; meta;"
}
]'curl --request POST \
--url https://api.aisa.one/apis/v1/dataforseo/on_page/instant_pages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"custom_js": "meta = {}; meta.url = document.URL; meta;",
"enable_javascript": true,
"url": "https://dataforseo.com/blog"
}
]
'import requests
url = "https://api.aisa.one/apis/v1/dataforseo/on_page/instant_pages"
payload = [
{
"custom_js": "meta = {}; meta.url = document.URL; meta;",
"enable_javascript": True,
"url": "https://dataforseo.com/blog"
}
]
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([
{
custom_js: 'meta = {}; meta.url = document.URL; meta;',
enable_javascript: true,
url: 'https://dataforseo.com/blog'
}
])
};
fetch('https://api.aisa.one/apis/v1/dataforseo/on_page/instant_pages', 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.aisa.one/apis/v1/dataforseo/on_page/instant_pages",
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([
[
'custom_js' => 'meta = {}; meta.url = document.URL; meta;',
'enable_javascript' => true,
'url' => 'https://dataforseo.com/blog'
]
]),
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.aisa.one/apis/v1/dataforseo/on_page/instant_pages"
payload := strings.NewReader("[\n {\n \"custom_js\": \"meta = {}; meta.url = document.URL; meta;\",\n \"enable_javascript\": true,\n \"url\": \"https://dataforseo.com/blog\"\n }\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.aisa.one/apis/v1/dataforseo/on_page/instant_pages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"custom_js\": \"meta = {}; meta.url = document.URL; meta;\",\n \"enable_javascript\": true,\n \"url\": \"https://dataforseo.com/blog\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/dataforseo/on_page/instant_pages")
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 {\n \"custom_js\": \"meta = {}; meta.url = document.URL; meta;\",\n \"enable_javascript\": true,\n \"url\": \"https://dataforseo.com/blog\"\n }\n]"
response = http.request(request)
puts response.read_body{
"cost": 123,
"status_code": 123,
"status_message": "<string>",
"tasks_count": 123,
"tasks_error": 123,
"time": "<string>",
"version": "<string>",
"tasks": [
{
"cost": 123,
"data": {},
"id": "<string>",
"path": [
"<string>"
],
"result_count": 123,
"status_code": 123,
"status_message": "<string>",
"time": "<string>",
"result": [
{
"crawl_gateway_address": "<string>",
"crawl_progress": "<string>",
"crawl_status": {},
"items": [
{
"accept_type": "<string>",
"fetch_timing": {
"duration_time": 123,
"fetch_end": 123,
"fetch_start": 123
},
"is_resource": true,
"meta": {
"broken_html": {
"errors": [
{
"column": 123,
"line": 123,
"message": "<string>",
"status_code": 123
}
],
"warnings": [
{
"column": 123,
"line": 123,
"message": "<string>",
"status_code": 123
}
]
},
"canonical": "<string>",
"charset": 123,
"content": {
"automated_readability_index": 123,
"coleman_liau_readability_index": 123,
"dale_chall_readability_index": 123,
"description_to_content_consistency": 123,
"flesch_kincaid_readability_index": 123,
"meta_keywords_to_content_consistency": 123,
"plain_text_rate": 123,
"plain_text_size": 123,
"plain_text_word_count": 123,
"smog_readability_index": 123,
"title_to_content_consistency": 123
},
"cumulative_layout_shift": 123,
"deprecated_tags": [
"<string>"
],
"description": "<string>",
"description_length": 123,
"duplicate_meta_tags": [
"<string>"
],
"external_links_count": 123,
"favicon": "<string>",
"follow": true,
"generator": "<string>",
"htags": {},
"images_count": 123,
"images_size": 123,
"inbound_links_count": 123,
"internal_links_count": 123,
"meta_keywords": "<string>",
"meta_title": "<string>",
"render_blocking_scripts_count": 123,
"render_blocking_stylesheets_count": 123,
"scripts_count": 123,
"scripts_size": 123,
"social_media_tags": {},
"spell": {
"hunspell_language_code": "<string>",
"misspelled": [
{
"word": "<string>"
}
]
},
"stylesheets_count": 123,
"stylesheets_size": 123,
"title": "<string>",
"title_length": 123
},
"cache_control": {
"cachable": true,
"ttl": 123
},
"checks": {},
"content_encoding": "<string>",
"encoded_size": 123,
"fetch_time": "<string>",
"last_modified": {
"header": "<string>",
"meta_tag": "<string>",
"sitemap": "<string>"
},
"location": "<string>",
"media_type": "<string>",
"resource_errors": {
"errors": [
{
"column": 123,
"line": 123,
"message": "<string>",
"status_code": 123
}
],
"warnings": [
{
"column": 123,
"line": 123,
"message": "<string>",
"status_code": 123
}
]
},
"resource_type": "<string>",
"server": "<string>",
"size": 123,
"status_code": 123,
"total_transfer_size": 123,
"url": "<string>",
"broken_links": true,
"broken_resources": true,
"click_depth": 123,
"custom_js_client_exception": "<string>",
"custom_js_response": {},
"duplicate_content": true,
"duplicate_description": true,
"duplicate_title": true,
"onpage_score": 123,
"page_timing": {
"connection_time": 123,
"dom_complete": 123,
"download_time": 123,
"duration_time": 123,
"fetch_end": 123,
"fetch_start": 123,
"first_input_delay": 123,
"largest_contentful_paint": 123,
"request_sent_time": 123,
"time_to_interactive": 123,
"time_to_secure_connection": 123,
"waiting_time": 123
},
"relative_url_length": 123,
"total_dom_size": 123,
"url_length": 123
}
],
"items_count": 123
}
]
}
]
}Request contract
- Method and path: POST /apis/v1/dataforseo/on_page/instant_pages
- Availability: enabled
- Request URL template: https://api.aisa.one/apis/v1/dataforseo/on_page/instant_pages
- Runtime facts: 6ab8fec17df1d5dcdff2e036dd1eb40587752b774ec040ab4eb0cc6946c3dd3c
{
"operationId": "any_dataforseo_apis_v1_dataforseo_on_page_instant_pages",
"method": "POST",
"path": "/apis/v1/dataforseo/on_page/instant_pages",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [],
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"example": [
{
"custom_js": "meta = {}; meta.url = document.URL; meta;",
"enable_javascript": true,
"url": "https://dataforseo.com/blog"
}
],
"items": {
"oneOf": [
{
"example": [
{
"custom_js": "meta = {}; meta.url = document.URL; meta;",
"enable_javascript": true,
"url": "https://dataforseo.com/blog"
}
],
"properties": {
"accept_language": {
"description": "language header for accessing the websiteoptional fieldall locale formats are supported (xx, xx-XX, xxx-XX, etc.)Note: if you do not specify this parameter, some websites may deny access; in this case, pages will be returned with the \"type\":\"broken in the response array",
"type": [
"string",
"null"
]
},
"browser_preset": {
"description": "preset for browser screen parametersoptional fieldif you use this field, you don't need to indicate browser_screen_width, browser_screen_height, browser_screen_scale_factorpossible values:desktop, mobile, tabletdesktop preset will apply the following values:browser_screen_width: 1920browser_screen_height: 1080browser_screen_scale_factor: 1mobile preset will apply the following values:browser_screen_width: 390browser_screen_height: 844browser_screen_scale_factor: 3tablet preset will apply the following values:browser_screen_width: 1024browser_screen_height: 1366browser_screen_scale_factor: 2Note: to use this parameter, set enable_javascript or enable_browser_rendering to true",
"type": [
"string",
"null"
]
},
"browser_screen_height": {
"description": "browser screen heightoptional fieldyou can set a custom browser screen height to perform audit for a particular device;if you use this field, you don't need to indicate browser_preset as it will be ignored;Note: to use this parameter, set enable_javascript or enable_browser_rendering to trueminimum value, in pixels: 240maximum value, in pixels: 9999",
"type": [
"integer",
"null"
]
},
"browser_screen_scale_factor": {
"description": "browser screen scale factoroptional fieldyou can set a custom browser screen resolution ratio to perform audit for a particular device;if you use this field, you don't need to indicate browser_preset as it will be ignored;Note: to use this parameter, set enable_javascript or enable_browser_rendering to trueminimum value: 0.5maximum value: 3",
"type": [
"number",
"null"
]
},
"browser_screen_width": {
"description": "browser screen widthoptional fieldyou can set a custom browser screen width to perform audit for a particular device;if you use this field, you don't need to indicate browser_preset as it will be ignored;Note: to use this parameter, set enable_javascript or enable_browser_rendering to trueminimum value, in pixels: 240maximum value, in pixels: 9999",
"format": "int64",
"type": [
"integer",
"null"
]
},
"check_spell": {
"description": "check spellingoptional fieldset to true to check spelling on a website using Hunspell librarydefault value: false",
"type": [
"boolean",
"null"
]
},
"checks_threshold": {
"additionalProperties": {
"format": "int64",
"type": [
"integer",
"null"
]
},
"description": "custom threshold values for checksoptional fieldyou can specify custom threshold values for the parameters included in the checks array of OnPage API responses;Note: only integer threshold values can be modified;",
"type": [
"object",
"null"
]
},
"custom_js": {
"description": "custom javascriptoptional fieldNote that the execution time for the script you enter here should be 700 ms maximum;for example, you can use the following JS snippet to check if the website contains Google Tag Manager as a scr attribute:let meta = { haveGoogleAnalytics: false, haveTagManager: false };rnfor (var i = 0; i < document.scripts.length; i++) {rn let src = document.scripts[i].getAttribute(\"src\");rn if (src != undefined) {rn if (src.indexOf(\"analytics.js\") >= 0)rn meta.haveGoogleAnalytics = true;rntif (src.indexOf(\"gtm.js\") >= 0)rn meta.haveTagManager = true;rn }rn}rnmeta;the returned value depends on what you specified in this field. For instance, if you specify the following script:meta = {}; meta.url = document.URL; meta.test = 'test'; meta;as a response you will receive the following data:\"custom_js_response\": {\"url\": \"https://dataforseo.com/\",\"test\": \"test\"}",
"type": [
"string",
"null"
]
},
"custom_user_agent": {
"description": "custom user agentoptional fieldcustom user agent for crawling a websiteexample: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36default value: Mozilla/5.0 (compatible; RSiteAuditor)",
"type": [
"string",
"null"
]
},
"disable_cookie_popup": {
"description": "disable the cookie popup optional fieldset to true if you want to disable the popup requesting cookie consent from the user;default value:false",
"type": [
"boolean",
"null"
]
},
"enable_browser_rendering": {
"description": "emulate browser rendering to measure Core Web Vitalsoptional fieldby using this parameter you will be able to emulate a browser when loading a web page;enable_browser_rendering loads styles, images, fonts, animations, videos, and other resources on a page;default value: falseset to true to obtain Core Web Vitals (FID, CLS, LCP) metrics in the response;if you use this field, parameters enable_javascript, and load_resources are enabled automatically;Note: if you use this parameter, additional charges will apply; learn more about the cost of tasks with this parameter in our help article; the cost can be calculated on the Pricing Page",
"type": [
"boolean",
"null"
]
},
"enable_javascript": {
"description": "load javascript on a pageoptional fieldset to true if you want to load the scripts available on a pagedefault value: falseNote: if you use this parameter, additional charges will apply; learn more about the cost of tasks with this parameter in our help article; the cost can be calculated on the Pricing Page",
"type": [
"boolean",
"null"
]
},
"enable_xhr": {
"description": "enable XMLHttpRequest on a pageoptional fieldset to true if you want our crawler to request data from a web server using the XMLHttpRequest objectdefault value:falseif you use this field, enable_javascript must be set to true;",
"type": [
"boolean",
"null"
]
},
"ip_pool_for_scan": {
"description": "proxy pooloptional fieldyou can choose a location of the proxy pool that will be used to obtain the requested data;the parameter can be used if page content is inaccessible in one of the locations, resulting in occasional site_unreachable errorspossible values: us, de",
"type": [
"string",
"null"
]
},
"load_resources": {
"description": "load resourcesoptional fieldset to true if you want to load image, stylesheets, scripts, and broken resourcesdefault value: falseNote: if you use this parameter, additional charges will apply; learn more about the cost of tasks with this parameter in our help article; the cost can be calculated on the Pricing Page",
"type": [
"boolean",
"null"
]
},
"return_despite_timeout": {
"description": "return data on pages despite the timeout erroroptional fieldif true, the data will be provided on pages that failed to load within 120 seconds and responded with a timeout error;default value: false",
"type": [
"boolean",
"null"
]
},
"store_raw_html": {
"description": "store HTML of a crawled pageoptional fieldset to true if you want get the HTML of the page using the OnPage Raw HTML endpointdefault value: false",
"type": [
"boolean",
"null"
]
},
"switch_pool": {
"description": "switch proxy pooloptional fieldif true, additional proxy pools will be used to obtain the requested data;the parameter can be used if a multitude of tasks is set simultaneously, resulting in occasional rate-limit and/or site_unreachable errors",
"type": [
"boolean",
"null"
]
},
"url": {
"description": "target page urlrequired fieldabsolute URL of the target page;Note #1: results will be returned for the specified URL only;Note #2: to prevent denial-of-service events, tasks that contain a duplicate crawl host will be returned with a 40501 error;to prevent this error from occurring, avoid setting tasks with the same domain if at least one of your previous tasks with this domain (including a page URL on the domain) is still in a crawling queue",
"type": "string"
},
"validate_micromarkup": {
"description": "enable microdata validationoptional fieldif set to true, you can use the OnPage API Microdata endpoint with the id of the task;default value: false",
"type": [
"boolean",
"null"
]
}
},
"type": "object"
}
],
"type": [
"object",
"null"
]
},
"type": "array"
}
}
}
},
"x-aisa-status": "enabled",
"x-aisa-pricing": {
"cost_contract": "response_usd",
"customer_multiplier": 1.0,
"customer_pricing": "provider_cost_multiplier",
"default_request_estimate_usd": 0.0051,
"estimate_source": "profile_seed",
"evidence_source": "response_body"
},
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
Cost and request rules
Usage-based billing; Default request estimate: $0.0051 USD (not a fixed price). Account-specific pricing and final settlement may differ. Published reference values are not an account-specific quote or a settled charge. For endpoints supporting X-AISA-Cost-Mode: quote, obtain a free quote for your exact request before execution; reconcile the settled cost with response metadata and Usage Logs. USD amounts use 1,000,000 integer micro-USD per dollar.- Default request reference estimate (USD): 0.0051
- Cost contract: response_usd
- Published reference multiplier: 1.0
- Settlement evidence source: response_body
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
language header for accessing the websiteoptional fieldall locale formats are supported (xx, xx-XX, xxx-XX, etc.)Note: if you do not specify this parameter, some websites may deny access; in this case, pages will be returned with the "type":"broken in the response array
preset for browser screen parametersoptional fieldif you use this field, you don't need to indicate browser_screen_width, browser_screen_height, browser_screen_scale_factorpossible values:desktop, mobile, tabletdesktop preset will apply the following values:browser_screen_width: 1920browser_screen_height: 1080browser_screen_scale_factor: 1mobile preset will apply the following values:browser_screen_width: 390browser_screen_height: 844browser_screen_scale_factor: 3tablet preset will apply the following values:browser_screen_width: 1024browser_screen_height: 1366browser_screen_scale_factor: 2Note: to use this parameter, set enable_javascript or enable_browser_rendering to true
browser screen heightoptional fieldyou can set a custom browser screen height to perform audit for a particular device;if you use this field, you don't need to indicate browser_preset as it will be ignored;Note: to use this parameter, set enable_javascript or enable_browser_rendering to trueminimum value, in pixels: 240maximum value, in pixels: 9999
browser screen scale factoroptional fieldyou can set a custom browser screen resolution ratio to perform audit for a particular device;if you use this field, you don't need to indicate browser_preset as it will be ignored;Note: to use this parameter, set enable_javascript or enable_browser_rendering to trueminimum value: 0.5maximum value: 3
browser screen widthoptional fieldyou can set a custom browser screen width to perform audit for a particular device;if you use this field, you don't need to indicate browser_preset as it will be ignored;Note: to use this parameter, set enable_javascript or enable_browser_rendering to trueminimum value, in pixels: 240maximum value, in pixels: 9999
check spellingoptional fieldset to true to check spelling on a website using Hunspell librarydefault value: false
custom threshold values for checksoptional fieldyou can specify custom threshold values for the parameters included in the checks array of OnPage API responses;Note: only integer threshold values can be modified;
Show child attributes
Show child attributes
custom javascriptoptional fieldNote that the execution time for the script you enter here should be 700 ms maximum;for example, you can use the following JS snippet to check if the website contains Google Tag Manager as a scr attribute:let meta = { haveGoogleAnalytics: false, haveTagManager: false };rnfor (var i = 0; i < document.scripts.length; i++) {rn let src = document.scripts[i].getAttribute("src");rn if (src != undefined) {rn if (src.indexOf("analytics.js") >= 0)rn meta.haveGoogleAnalytics = true;rntif (src.indexOf("gtm.js") >= 0)rn meta.haveTagManager = true;rn }rn}rnmeta;the returned value depends on what you specified in this field. For instance, if you specify the following script:meta = {}; meta.url = document.URL; meta.test = 'test'; meta;as a response you will receive the following data:"custom_js_response": {"url": "https://dataforseo.com/","test": "test"}
custom user agentoptional fieldcustom user agent for crawling a websiteexample: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36default value: Mozilla/5.0 (compatible; RSiteAuditor)
disable the cookie popup optional fieldset to true if you want to disable the popup requesting cookie consent from the user;default value:false
emulate browser rendering to measure Core Web Vitalsoptional fieldby using this parameter you will be able to emulate a browser when loading a web page;enable_browser_rendering loads styles, images, fonts, animations, videos, and other resources on a page;default value: falseset to true to obtain Core Web Vitals (FID, CLS, LCP) metrics in the response;if you use this field, parameters enable_javascript, and load_resources are enabled automatically;Note: if you use this parameter, additional charges will apply; learn more about the cost of tasks with this parameter in our help article; the cost can be calculated on the Pricing Page
load javascript on a pageoptional fieldset to true if you want to load the scripts available on a pagedefault value: falseNote: if you use this parameter, additional charges will apply; learn more about the cost of tasks with this parameter in our help article; the cost can be calculated on the Pricing Page
enable XMLHttpRequest on a pageoptional fieldset to true if you want our crawler to request data from a web server using the XMLHttpRequest objectdefault value:falseif you use this field, enable_javascript must be set to true;
proxy pooloptional fieldyou can choose a location of the proxy pool that will be used to obtain the requested data;the parameter can be used if page content is inaccessible in one of the locations, resulting in occasional site_unreachable errorspossible values: us, de
load resourcesoptional fieldset to true if you want to load image, stylesheets, scripts, and broken resourcesdefault value: falseNote: if you use this parameter, additional charges will apply; learn more about the cost of tasks with this parameter in our help article; the cost can be calculated on the Pricing Page
return data on pages despite the timeout erroroptional fieldif true, the data will be provided on pages that failed to load within 120 seconds and responded with a timeout error;default value: false
store HTML of a crawled pageoptional fieldset to true if you want get the HTML of the page using the OnPage Raw HTML endpointdefault value: false
switch proxy pooloptional fieldif true, additional proxy pools will be used to obtain the requested data;the parameter can be used if a multitude of tasks is set simultaneously, resulting in occasional rate-limit and/or site_unreachable errors
target page urlrequired fieldabsolute URL of the target page;Note #1: results will be returned for the specified URL only;Note #2: to prevent denial-of-service events, tasks that contain a duplicate crawl host will be returned with a 40501 error;to prevent this error from occurring, avoid setting tasks with the same domain if at least one of your previous tasks with this domain (including a page URL on the domain) is still in a crawling queue
enable microdata validationoptional fieldif set to true, you can use the OnPage API Microdata endpoint with the id of the task;default value: false
[
{
"custom_js": "meta = {}; meta.url = document.URL; meta;",
"enable_javascript": true,
"url": "https://dataforseo.com/blog"
}
]
Response
Successful operation
total tasks cost, USD
general status code you can find the full list of the response codes here
general informational message you can find the full list of general informational messages here
the number of tasks in the tasks array
the number of tasks in the tasks array returned with an error
total execution time, seconds
the current version of the API
array of tasks
Show child attributes
Show child attributes