Extract Structured Web Data
curl --request POST \
--url https://api.aisa.one/apis/v1/context-dev/extract-structured-web-data \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"output_schema": {
"properties": {
"company_name": {
"description": "The company's public name.",
"type": "string"
}
},
"required": [
"company_name"
],
"type": "object"
},
"url": "https://example.com"
}
EOFimport requests
url = "https://api.aisa.one/apis/v1/context-dev/extract-structured-web-data"
payload = {
"output_schema": {
"properties": { "company_name": {
"description": "The company's public name.",
"type": "string"
} },
"required": ["company_name"],
"type": "object"
},
"url": "https://example.com"
}
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({
output_schema: {
properties: {company_name: {description: 'The company\'s public name.', type: 'string'}},
required: ['company_name'],
type: 'object'
},
url: 'https://example.com'
})
};
fetch('https://api.aisa.one/apis/v1/context-dev/extract-structured-web-data', 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/context-dev/extract-structured-web-data",
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([
'output_schema' => [
'properties' => [
'company_name' => [
'description' => 'The company\'s public name.',
'type' => 'string'
]
],
'required' => [
'company_name'
],
'type' => 'object'
],
'url' => 'https://example.com'
]),
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/context-dev/extract-structured-web-data"
payload := strings.NewReader("{\n \"output_schema\": {\n \"properties\": {\n \"company_name\": {\n \"description\": \"The company's public name.\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"company_name\"\n ],\n \"type\": \"object\"\n },\n \"url\": \"https://example.com\"\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/context-dev/extract-structured-web-data")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"output_schema\": {\n \"properties\": {\n \"company_name\": {\n \"description\": \"The company's public name.\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"company_name\"\n ],\n \"type\": \"object\"\n },\n \"url\": \"https://example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/context-dev/extract-structured-web-data")
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 \"output_schema\": {\n \"properties\": {\n \"company_name\": {\n \"description\": \"The company's public name.\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"company_name\"\n ],\n \"type\": \"object\"\n },\n \"url\": \"https://example.com\"\n}"
response = http.request(request)
puts response.read_body{
"data": {},
"metadata": {
"maxCrawlDepth": 1,
"numBlocked": 1,
"numFailed": 1,
"numSkipped": 1,
"numSucceeded": 1,
"numUrls": 1
},
"url": "<string>",
"key_metadata": {
"credits_consumed": 1,
"credits_remaining": 1
},
"urls_analyzed": [
"<string>"
]
}Context.dev
Extract Structured Web Data
Extract Structured Web Data
POST
https://api.aisa.one
/
apis
/
v1
/
context-dev
/
extract-structured-web-data
Extract Structured Web Data
curl --request POST \
--url https://api.aisa.one/apis/v1/context-dev/extract-structured-web-data \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"output_schema": {
"properties": {
"company_name": {
"description": "The company's public name.",
"type": "string"
}
},
"required": [
"company_name"
],
"type": "object"
},
"url": "https://example.com"
}
EOFimport requests
url = "https://api.aisa.one/apis/v1/context-dev/extract-structured-web-data"
payload = {
"output_schema": {
"properties": { "company_name": {
"description": "The company's public name.",
"type": "string"
} },
"required": ["company_name"],
"type": "object"
},
"url": "https://example.com"
}
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({
output_schema: {
properties: {company_name: {description: 'The company\'s public name.', type: 'string'}},
required: ['company_name'],
type: 'object'
},
url: 'https://example.com'
})
};
fetch('https://api.aisa.one/apis/v1/context-dev/extract-structured-web-data', 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/context-dev/extract-structured-web-data",
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([
'output_schema' => [
'properties' => [
'company_name' => [
'description' => 'The company\'s public name.',
'type' => 'string'
]
],
'required' => [
'company_name'
],
'type' => 'object'
],
'url' => 'https://example.com'
]),
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/context-dev/extract-structured-web-data"
payload := strings.NewReader("{\n \"output_schema\": {\n \"properties\": {\n \"company_name\": {\n \"description\": \"The company's public name.\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"company_name\"\n ],\n \"type\": \"object\"\n },\n \"url\": \"https://example.com\"\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/context-dev/extract-structured-web-data")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"output_schema\": {\n \"properties\": {\n \"company_name\": {\n \"description\": \"The company's public name.\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"company_name\"\n ],\n \"type\": \"object\"\n },\n \"url\": \"https://example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/context-dev/extract-structured-web-data")
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 \"output_schema\": {\n \"properties\": {\n \"company_name\": {\n \"description\": \"The company's public name.\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"company_name\"\n ],\n \"type\": \"object\"\n },\n \"url\": \"https://example.com\"\n}"
response = http.request(request)
puts response.read_body{
"data": {},
"metadata": {
"maxCrawlDepth": 1,
"numBlocked": 1,
"numFailed": 1,
"numSkipped": 1,
"numSucceeded": 1,
"numUrls": 1
},
"url": "<string>",
"key_metadata": {
"credits_consumed": 1,
"credits_remaining": 1
},
"urls_analyzed": [
"<string>"
]
}请求规范
- 方法与路径: POST /apis/v1/context-dev/extract-structured-web-data
- 可用状态: enabled
- 请求 URL 模板:
https://api.aisa.one/apis/v1/context-dev/extract-structured-web-data
{
"operationId": "context-dev.extract-structured-web-data",
"method": "POST",
"path": "/apis/v1/context-dev/extract-structured-web-data",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [],
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"fact_check": {
"default": false,
"description": "Require every returned value to be grounded in page content. Unsupported fields are returned as null or empty instead of inferred.",
"type": "boolean"
},
"follow_subdomains": {
"default": false,
"description": "Follow links on subdomains of the starting domain.",
"type": "boolean"
},
"instructions": {
"description": "Optional extraction guidance or field interpretation, up to 2000 characters.",
"maxLength": 2000,
"type": "string"
},
"max_depth": {
"description": "Maximum link depth from the starting URL. Use 0 to analyze only the starting page; omit for no crawl-depth limit.",
"minimum": 0,
"type": "integer"
},
"max_pages": {
"default": 5,
"description": "Maximum pages to analyze (1-50). Higher values increase the price.",
"maximum": 50,
"minimum": 1,
"type": "integer"
},
"output_schema": {
"additionalProperties": true,
"description": "JSON Schema describing the object to extract. Add descriptions to non-obvious properties so the extractor can interpret them correctly.",
"examples": [
{
"properties": {
"company_name": {
"description": "The company's public name.",
"type": "string"
}
},
"required": [
"company_name"
],
"type": "object"
}
],
"type": "object"
},
"stop_after_ms": {
"default": 80000,
"description": "Soft crawl time budget in milliseconds (10000-110000).",
"maximum": 110000,
"minimum": 10000,
"type": "integer"
},
"tags": {
"description": "Usage-tracking tags. Provide at most 20 tags of 1-50 characters each.",
"items": {
"maxLength": 50,
"minLength": 1,
"type": "string"
},
"maxItems": 20,
"type": "array"
},
"url": {
"description": "Starting HTTP or HTTPS website URL to crawl.",
"examples": [
"https://example.com"
],
"format": "uri",
"minLength": 1,
"type": "string"
}
},
"required": [
"url",
"output_schema"
],
"type": "object"
}
}
},
"required": true
},
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
费用与请求规则
按实际用量收费。 默认请求预估费用:$0.0103 USD。 最终费用以实际用量为准。 账户适用价格可能不同;支持报价的接口可按实际请求获取报价。授权
请求体
application/json
JSON Schema describing the object to extract. Add descriptions to non-obvious properties so the extractor can interpret them correctly.
示例:
{
"properties": {
"company_name": {
"description": "The company's public name.",
"type": "string"
}
},
"required": ["company_name"],
"type": "object"
}