Interface description: Get the main text of the specified URL and page information by creating Extrac API collection task.
Request address: https://aiwebapi.dataify.com/extract
Request method: POST
Request format: application/json or application/x-www-form-urlencoded
Headers:
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Fixed format: Authorization: Bearer <Your YOUR_API_TOKEN>. Your_API_TOKEN can be obtained in Dashboard → Settings → Token Management. Custom Token request headers are not supported. |
Body:
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
unique_id | string | Yes | Used to specify the tool to use, fixed parameters: extract |
url | string | Yes | Target URL address to collect. |
formats | array of string | No | Output format for setting the body of the web page. Optional values: markdown、raw_html、clean_html、links. Default value is markdown. |
advanced_mode | boolean | No | This setting configures the webpage scraping method. false indicates using HTTP scraping without rendering; true enables an automatic unlocking strategy, sequentially attempting scraping without rendering, scraping with browser rendering, and scraping with browser rendering combined with a webpage unlocker, only proceeding to the next level after the previous level fails. Different scraping methods have different costs; please refer to the pricing details. The default value is true. |
country | string | No | For setting up the country or area for collecting requests, use two uppercase ISO country codes. |
include_tags | array of string | No | Used to specify that only content corresponding to a specified HTML tag or CSS Selector should be retained during data collection. Maximum of 50 entries, each with a maximum length of 2048 UTF-8 bytes. For example: ["data-testid=qsp-price1","data-testid=qsp-price2"]. |
exclude_tags | array of string | No | This is used to specify the HTML tags or CSS selectors to be removed during data collection. A maximum of 50 entries are allowed, each with a maximum length of 2048 UTF-8 bytes. For example: ["data-testid=qsp-price1","data-testid=qsp-price2"]. |
only_main_content | boolean | No | This setting determines whether to retain only the cleaned main content. true means retaining only the cleaned main content; false means retaining more of the cleaned page content. The default value is true. |
headers | object | No | This is used to set the HTTP request header information for the target website to collect data, and is configured in key-value pair format. It must not contain Host or hop-by-hop headers. |
timeout_ms | integer | No | The maximum processing time used to set the body of a single web page to be collected, covering the acquisition, rendering and extraction process, in milliseconds. range 1000~120000, Default value is 60000. |
wait_for_ms | integer | No | This setting determines the system loading time in milliseconds when collecting content pages. The value range is 0 to 30000. The default value is 0. When passed together with timeout_ms, wait_for_ms must not exceed half of timeout_ms. |
max_age_ms | integer | No | This setting determines the maximum acceptable cache duration when collecting content pages, in milliseconds. The value range is 0 to 172,800,000 (2 days); setting it to 0 forces a cache pull from the origin server. Default values are not specified in the original parameter table. |
{
"markdown": "# Article",
"raw_html": "<main>Article</main>",
"clean_html": "<main>Article</main>",
"links": [
"https://example.com/about"
]
}
| Parameter Name | Parameter Type | Description |
|---|---|---|
markdown | string | The body of the page in Markdown format. Returns only if formats contains markdown; may be null if generation fails or no content is available. |
raw_html | string | The original HTML of the page. Returns only if formats contains raw_html; may be null if generation fails or no content is available. |
clean_html | string | The cleaned HTML of the page. Returns only if formats contains clean_html; may be null if generation fails or no content is available. |
links | array of string | The absolute HTTP(S) links extracted from the page. Returns only if formats contains links; may be an empty array if no links are found. |