其他域名

这种数据类型是通用的并且可以应用于任何域名。它接受带有附加参数的 URL。您可以在下表中找到可用参数的列表。

查询参数

- 必须提供的参数

代码示例

在这个示例中,API 将检索一个电子商务产品页面。包括所有可用参数(尽管在同一个请求中并不总是必要的或兼容的),以便让您知道如何格式化您的请求:

{
    "source": "universal", 
    "url": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html", 
    "user_agent_type": "desktop",
    "geo_location": "United States",
    "context": [
        {
            "key": "headers", 
            "value": {
                "Accept-Language": "en-US", 
                "Content-Type": "application/octet-stream", 
                "Custom-Header-Name": "custom header content"
                }
        }, 
        {
            "key": "cookies", 
            "value": [
                {
                    "key": "NID", 
                    "value": "1234567890"
                },
                {
                    "key": "1P JAR",
                    "value": "0987654321"
                }]
        },
        {
            "key": "follow_redirects",
            "value": true
        },
        {
            "key": "http_method", "value": "get"
        },
        {
            "key": "content",
            "value": "base64EncodedPOSTBody"
        },
        {
            "key": "successful_status_codes",
            "value": [303, 808, 909]
        }]
}

以上示例使用了 Realtime 集成方法。如果您想在您的查询中使用一些其他集成方法(如推拉代理端),请参考集成方法部分。

最后更新于