curl --request POST \
--url https://api.aisa.one/apis/v1/dataforseo/on_page/content_parsing/live \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"url": "https://dataforseo.com/blog/a-versatile-alternative-to-google-trends-exploring-the-power-of-dataforseo-trends-api"
}
]
'import requests
url = "https://api.aisa.one/apis/v1/dataforseo/on_page/content_parsing/live"
payload = [{ "url": "https://dataforseo.com/blog/a-versatile-alternative-to-google-trends-exploring-the-power-of-dataforseo-trends-api" }]
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: 'https://dataforseo.com/blog/a-versatile-alternative-to-google-trends-exploring-the-power-of-dataforseo-trends-api'
}
])
};
fetch('https://api.aisa.one/apis/v1/dataforseo/on_page/content_parsing/live', 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/content_parsing/live",
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://dataforseo.com/blog/a-versatile-alternative-to-google-trends-exploring-the-power-of-dataforseo-trends-api'
]
]),
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/content_parsing/live"
payload := strings.NewReader("[\n {\n \"url\": \"https://dataforseo.com/blog/a-versatile-alternative-to-google-trends-exploring-the-power-of-dataforseo-trends-api\"\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/content_parsing/live")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"url\": \"https://dataforseo.com/blog/a-versatile-alternative-to-google-trends-exploring-the-power-of-dataforseo-trends-api\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/dataforseo/on_page/content_parsing/live")
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 \"url\": \"https://dataforseo.com/blog/a-versatile-alternative-to-google-trends-exploring-the-power-of-dataforseo-trends-api\"\n }\n]"
response = http.request(request)
puts response.read_body{
"version": "<string>",
"status_code": 123,
"status_message": "<string>",
"time": "<string>",
"cost": 123,
"tasks_count": 123,
"tasks_error": 123,
"tasks": [
{
"id": "<string>",
"status_code": 123,
"status_message": "<string>",
"time": "<string>",
"cost": 123,
"result_count": 123,
"path": [
"<string>"
],
"data": {},
"result": [
{
"crawl_progress": "<string>",
"crawl_status": {
"max_crawl_pages": 123,
"pages_in_queue": 123,
"pages_crawled": 123
},
"items_count": 123,
"items": [
{
"type": "<string>",
"fetch_time": "<string>",
"status_code": 123,
"page_content": {
"header": {
"primary_content": [
{
"text": "<string>",
"url": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
]
}
],
"secondary_content": [
{
"text": "<string>",
"url": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
]
}
],
"table_content": [
{
"header": [
{
"row_cells": [
{
"text": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
],
"is_header": true
}
]
}
],
"body": [
{
"row_cells": [
{
"text": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
],
"is_header": true
}
]
}
],
"footer": [
{
"row_cells": [
{
"text": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
],
"is_header": true
}
]
}
]
}
]
},
"footer": {
"primary_content": [
{
"text": "<string>",
"url": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
]
}
],
"secondary_content": [
{
"text": "<string>",
"url": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
]
}
],
"table_content": [
{
"header": [
{
"row_cells": [
{
"text": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
],
"is_header": true
}
]
}
],
"body": [
{
"row_cells": [
{
"text": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
],
"is_header": true
}
]
}
],
"footer": [
{
"row_cells": [
{
"text": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
],
"is_header": true
}
]
}
]
}
]
},
"main_topic": [
{
"h_title": "<string>",
"main_title": "<string>",
"author": "<string>",
"language": "<string>",
"level": 123,
"primary_content": [
{
"text": "<string>",
"url": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
]
}
],
"secondary_content": [
{
"text": "<string>",
"url": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
]
}
],
"table_content": [
{
"header": [
{
"row_cells": [
{
"text": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
],
"is_header": true
}
]
}
],
"body": [
{
"row_cells": [
{
"text": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
],
"is_header": true
}
]
}
],
"footer": [
{
"row_cells": [
{
"text": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
],
"is_header": true
}
]
}
]
}
]
}
],
"secondary_topic": [
{
"h_title": "<string>",
"main_title": "<string>",
"author": "<string>",
"language": "<string>",
"level": 123,
"primary_content": [
{
"text": "<string>",
"url": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
]
}
],
"secondary_content": [
{
"text": "<string>",
"url": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
]
}
],
"table_content": [
{
"header": [
{
"row_cells": [
{
"text": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
],
"is_header": true
}
]
}
],
"body": [
{
"row_cells": [
{
"text": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
],
"is_header": true
}
]
}
],
"footer": [
{
"row_cells": [
{
"text": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
],
"is_header": true
}
]
}
]
}
]
}
],
"ratings": [
{
"name": "<string>",
"rating_value": 123,
"rating_count": 123,
"max_rating_value": 123,
"relative_rating": 123
}
],
"offers": [
{
"name": "<string>",
"price": 123,
"price_currency": "<string>",
"price_valid_until": "<string>"
}
],
"comments": [
{
"rating": {
"name": "<string>",
"rating_value": 123,
"rating_count": 123,
"max_rating_value": 123,
"relative_rating": 123
},
"title": "<string>",
"publish_date": "<string>",
"author": "<string>",
"have_form": true,
"primary_content": [
{
"text": "<string>",
"url": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
]
}
]
}
],
"contacts": {
"telephones": [
"<string>"
],
"emails": [
"<string>"
]
}
},
"page_as_markdown": "<string>"
}
]
}
]
}
]
}实时 OnPage API 内容解析
立即把任意 url 解析成结构化内容,不需要先爬取——本家族唯一独立可用的工具。
curl --request POST \
--url https://api.aisa.one/apis/v1/dataforseo/on_page/content_parsing/live \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"url": "https://dataforseo.com/blog/a-versatile-alternative-to-google-trends-exploring-the-power-of-dataforseo-trends-api"
}
]
'import requests
url = "https://api.aisa.one/apis/v1/dataforseo/on_page/content_parsing/live"
payload = [{ "url": "https://dataforseo.com/blog/a-versatile-alternative-to-google-trends-exploring-the-power-of-dataforseo-trends-api" }]
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: 'https://dataforseo.com/blog/a-versatile-alternative-to-google-trends-exploring-the-power-of-dataforseo-trends-api'
}
])
};
fetch('https://api.aisa.one/apis/v1/dataforseo/on_page/content_parsing/live', 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/content_parsing/live",
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://dataforseo.com/blog/a-versatile-alternative-to-google-trends-exploring-the-power-of-dataforseo-trends-api'
]
]),
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/content_parsing/live"
payload := strings.NewReader("[\n {\n \"url\": \"https://dataforseo.com/blog/a-versatile-alternative-to-google-trends-exploring-the-power-of-dataforseo-trends-api\"\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/content_parsing/live")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"url\": \"https://dataforseo.com/blog/a-versatile-alternative-to-google-trends-exploring-the-power-of-dataforseo-trends-api\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/dataforseo/on_page/content_parsing/live")
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 \"url\": \"https://dataforseo.com/blog/a-versatile-alternative-to-google-trends-exploring-the-power-of-dataforseo-trends-api\"\n }\n]"
response = http.request(request)
puts response.read_body{
"version": "<string>",
"status_code": 123,
"status_message": "<string>",
"time": "<string>",
"cost": 123,
"tasks_count": 123,
"tasks_error": 123,
"tasks": [
{
"id": "<string>",
"status_code": 123,
"status_message": "<string>",
"time": "<string>",
"cost": 123,
"result_count": 123,
"path": [
"<string>"
],
"data": {},
"result": [
{
"crawl_progress": "<string>",
"crawl_status": {
"max_crawl_pages": 123,
"pages_in_queue": 123,
"pages_crawled": 123
},
"items_count": 123,
"items": [
{
"type": "<string>",
"fetch_time": "<string>",
"status_code": 123,
"page_content": {
"header": {
"primary_content": [
{
"text": "<string>",
"url": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
]
}
],
"secondary_content": [
{
"text": "<string>",
"url": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
]
}
],
"table_content": [
{
"header": [
{
"row_cells": [
{
"text": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
],
"is_header": true
}
]
}
],
"body": [
{
"row_cells": [
{
"text": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
],
"is_header": true
}
]
}
],
"footer": [
{
"row_cells": [
{
"text": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
],
"is_header": true
}
]
}
]
}
]
},
"footer": {
"primary_content": [
{
"text": "<string>",
"url": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
]
}
],
"secondary_content": [
{
"text": "<string>",
"url": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
]
}
],
"table_content": [
{
"header": [
{
"row_cells": [
{
"text": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
],
"is_header": true
}
]
}
],
"body": [
{
"row_cells": [
{
"text": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
],
"is_header": true
}
]
}
],
"footer": [
{
"row_cells": [
{
"text": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
],
"is_header": true
}
]
}
]
}
]
},
"main_topic": [
{
"h_title": "<string>",
"main_title": "<string>",
"author": "<string>",
"language": "<string>",
"level": 123,
"primary_content": [
{
"text": "<string>",
"url": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
]
}
],
"secondary_content": [
{
"text": "<string>",
"url": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
]
}
],
"table_content": [
{
"header": [
{
"row_cells": [
{
"text": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
],
"is_header": true
}
]
}
],
"body": [
{
"row_cells": [
{
"text": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
],
"is_header": true
}
]
}
],
"footer": [
{
"row_cells": [
{
"text": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
],
"is_header": true
}
]
}
]
}
]
}
],
"secondary_topic": [
{
"h_title": "<string>",
"main_title": "<string>",
"author": "<string>",
"language": "<string>",
"level": 123,
"primary_content": [
{
"text": "<string>",
"url": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
]
}
],
"secondary_content": [
{
"text": "<string>",
"url": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
]
}
],
"table_content": [
{
"header": [
{
"row_cells": [
{
"text": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
],
"is_header": true
}
]
}
],
"body": [
{
"row_cells": [
{
"text": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
],
"is_header": true
}
]
}
],
"footer": [
{
"row_cells": [
{
"text": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
],
"is_header": true
}
]
}
]
}
]
}
],
"ratings": [
{
"name": "<string>",
"rating_value": 123,
"rating_count": 123,
"max_rating_value": 123,
"relative_rating": 123
}
],
"offers": [
{
"name": "<string>",
"price": 123,
"price_currency": "<string>",
"price_valid_until": "<string>"
}
],
"comments": [
{
"rating": {
"name": "<string>",
"rating_value": 123,
"rating_count": 123,
"max_rating_value": 123,
"relative_rating": 123
},
"title": "<string>",
"publish_date": "<string>",
"author": "<string>",
"have_form": true,
"primary_content": [
{
"text": "<string>",
"url": "<string>",
"urls": [
{
"url": "<string>",
"anchor_text": "<string>"
}
]
}
]
}
],
"contacts": {
"telephones": [
"<string>"
],
"emails": [
"<string>"
]
}
},
"page_as_markdown": "<string>"
}
]
}
]
}
]
}url 解析成结构化内容,不需要先爬取——本家族唯一独立可用的工具。browser_preset、browser_screen_width、browser_screen_height、custom_user_agent 控制渲染,disable_cookie_popup 去掉同意弹层,store_raw_html 保留源码。example.com 实测 1.2 KB。响应包在信封里:数据在 tasks[0].result,成败在 tasks[0].status_code——请求被拒时 HTTP 仍是 200。 页面已在某次爬取里时改用 post_dataforseo_on_page_content_parsing,那个免费。
示例
curl -X POST "https://api.aisa.one/apis/v1/dataforseo/on_page/content_parsing/live" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '[{"url": "...", "custom_user_agent": "...", "browser_preset": "..."}]'
授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求体
URL of the content to parse
required field
URL of the page to parse
example:https://www.fujielectric.com/
custom user agent
optional field
custom user agent for crawling a website
example: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36
default value: Mozilla/5.0 (compatible; RSiteAuditor)
preset for browser screen parameters
optional field
if you use this field, you don't need to indicate browser_screen_width, browser_screen_height, browser_screen_scale_factor
possible values:desktop, mobile, tablet
desktop preset will apply the following values:
browser_screen_width: 1920browser_screen_height: 1080browser_screen_scale_factor: 1
mobile preset will apply the following values:
browser_screen_width: 390browser_screen_height: 844browser_screen_scale_factor: 3
tablet preset will apply the following values:
browser_screen_width: 1024browser_screen_height: 1366browser_screen_scale_factor: 2
Note: to use this parameter, set enable_javascript or enable_browser_rendering to true
browser screen width
optional field
you 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 true
minimum value, in pixels: 240
maximum value, in pixels: 9999
browser screen height
optional field
you 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 true
minimum value, in pixels: 240
maximum value, in pixels: 9999
browser screen scale factor
optional field
you 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 true
minimum value: 0.5
maximum value: 3
store HTML of a crawled page
optional field
set to true if you want to get the HTML of the page using the OnPage Raw HTML endpoint
default value: false
disable the cookie popup
optional field
set to true if you want to disable the popup requesting cookie consent from the user;
default value:false
language header for accessing the website
optional field
all 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
load javascript on a page
optional field
set to true if you want to load the scripts available on a page
default value: false
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
emulate browser rendering to measure Core Web Vitals
optional field
by 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: false
set to true to obtain Core Web Vitals (FID, CLS, LCP) metrics in the response;
if you use this field, enable_javascript, and load_resources parameters must be set to true
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
enable XMLHttpRequest on a page
optional field
set to true if you want our crawler to request data from a web server using the XMLHttpRequest object
default value:false
if you use this field, enable_javascript must be set to true;
switch proxy pool
optional field
if 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
proxy pool
optional field
you 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 errors
possible values: us, de
return page content as markdown
optional field
if set to true, the markdown-formatted content of the page will be returned in the page_as_markdown field of the response;
default value: false
[
{
"url": "https://dataforseo.com/blog/a-versatile-alternative-to-google-trends-exploring-the-power-of-dataforseo-trends-api"
}
]
响应
Successful operation
API 的当前版本
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
total execution time, seconds
任务总成本(美元)
tasks 数组中的任务数量
返回错误的 tasks 数组中的任务数量
array of tasks
Show child attributes
Show child attributes