API 文档资源

入门

  • 在哪里可以找到通过账户名和密码操作的API集成示例?

    登录后,进入API示例页面,便可找到所有相关的API集成方法:包括端口,通道以及其它API。该页面包含不同的代码语言,以及因需求不同而不同的示例,从基本集成到大规模请求。请注意:要使用该页面,你必须登录到亮数据控制面板。

  • 什么是API资源文档?如何使用?

    API文档描述了如何使用亮数据的API指令,以及用于自动化控制、账户、特定通道或产品,以及具体的代理设置。API指令通常在代码脚本中使用,亮数据的API支持多种编程语言,例如:shell、Node.js、Java、C#、VB、PHP、Python、Ruby、Perl等。举例说明,假如你想将亮数据与使用代理的自动爬取工具集成,可使用API白名单IP指令达到这个目的。你可以在API文档资料里找到全部的可用于控制您的账户的选项,包括通道分配/代理删除、计费信息以及带宽信息。请注意: 为了使用 API 文档,...

  • 相关条款细解

    ZONE-你想查看信息的具体通道名称。查看细节 CUSTOMER-你的账户ID,你可以从控制面板获取。 PASSWORD-你的通道密码。查看细节 COUNTRY-你想要删选信息的国家代码。(比如'-country-us' 指美国) API_TOKEN -你或者账户管理员在创建账户时通过账户设置创建的令牌。 账户权限类型: Admin-拥有全面管理账户的权限,删除和添加用户,计费功能控制等 Ops-拥有管理通道,访问权限,创建和删除通道,不能管理计费等资金 Finance- 可以管理帐单、查看和下...

统计信息

  • 获取某个通道的带宽统计信息

    API endpoint: GET /api/zone/bw Optional parameters: from=2018-07-01T00:00:00&to=2018-07-02T00:00:00   Shell curl "https://brightdata.com/api/zone/bw?zone=ZONE" -H "Authorization: Bearer API_TOKEN" Node.js #!/usr/bin/env node require('request-promise')({...

  • 获取所有通道的带宽统计信息

    API endpoint: GET /api/customer/bw Optional parameters: from=2018-07-01T00:00:00&to=2018-07-02T00:00:00   Shell curl "https://brightdata.com/api/customer/bw" -H "Authorization: Bearer API_TOKEN" Node.js #!/usr/bin/env node require('request-promise')({ ...

  • 获取某个通道的带宽和全部消费统计信息

    API endpoint: GET /api/zone/cost Optional parameters: from=2018-07-01T00:00:00&to=2018-07-02T00:00:00   Shell curl "https://brightdata.com/api/zone/cost?zone=ZONE" -H "Authorization: Bearer API_TOKEN" Node.js #!/usr/bin/env node require('request-promise...

管理代理网络的IP

  • 获取可用的机房代理和静态住宅代理的IP数量

    API endpoint: GET /api/zone/count_available_ips Parameters: zone=ZONE [string] - name of the Zone plan={...} [JSON object] - abstract plan parameters pool_ip_type=static_res [string] - should search in ISP instead of DC ips_type=shared|selective|dedic...

  • 获取最近想使用你的通道的IP

    API endpoint: GET /api/zone/recent_ips Parameter: zones=ZONE - To get attempting IPs to any of your zone : zones=* Sample Response: {"ZONE":["255.0.0.127","10.0.0.1"]}   Shell curl "https://brightdata.com/api/zone/recent_ips?zones=ZONE" -H "Authorizatio...

  • 获取某个通道可用的机房代理和静态住宅代理的独享IP

    API endpoint: GET /api/zone/route_ips Parameter: zone=ZONE[string] [required] country=COUNTRY_CODE[string] [optional] Sample Response: 10.0.0.0/24   Shell curl "https://brightdata.com/api/zone/route_ips?zone=ZONE&country=COUNTRY" -H "Authorization: Be...

  • 获取某个通道可用的动态住宅代理的独享IP数量

    API endpoint: GET /api/zone/route_vips Sample Response: ["us_7922_fl_hollywood_0","ma_36903_01_tetouan_5","br_52894_mg_montesclaros_99"]   Shell curl "https://brightdata.com/api/zone/route_vips?zone=ZONE" -H "Authorization: Bearer API_TOKEN" Node.js #!/...

账户管理

  • 通过API获取balance

    API endpoint: GET /api/customer/balance Sample Response: {"balance":456,"pending_costs":123} balance : the amount of money in your account pending_costs : the amount of money you will be billed for, as of this moment, in the next billing cycle   Shel...

  • 获取代理通道信息

    API endpoint: GET /api/zone Sample Response: {"ips":"any","password":["PASSWORD"],"plans":[{"start":"2019-07-15T18:08:59.269Z","type":"static","ips_type":"shared","ip_alloc_preset":"shared_block","bandwidth":"payperusage"}]}   Shell curl "https://bright...

  • 添加代理通道

    API endpoint: POST /api/zone POST body : zone [JSON] [Required] name=NAME [string] - Zone name plan [JSON] [Required] type="static|resident|unblocker" [string] 'static' : Datacenter, ISP 'resident' : Residential, Mobile, SERP 'unblocker' : unloc...

  • 移除代理通道

    API endpoint: DELETE /api/zone   Shell curl -X DELETE "https://brightdata.com/api/zone" -H "Content-Type: application/json" -H "Authorization: Bearer API_TOKEN" -d "{\"zone\":\"ZONE\"}" Node.js #!/usr/bin/env node require('request-promise')({ method: '...

  • 获取通道密码

    API endpoint: GET /api/zone/passwords Sample Response: {"passwords":["psw1","psw2"]}   Shell curl "https://brightdata.com/api/zone/passwords?zone=ZONE" -H "Authorization: Bearer API_TOKEN" Node.js #!/usr/bin/env node require('request-promise')({ url: '...

  • 获取使用通道权限

    API endpoint: GET /api/zone/permissions Sample Response: {"perms":["city","google"]}   Shell curl "https://brightdata.com/api/zone/permissions?zone=ZONE" -H "Authorization: Bearer API_TOKEN" Node.js #!/usr/bin/env node require('request-promise')({ url:...

其它

  • 获取当前服务状态

    API endpoint: GET /api/network_status/NETWORK_TYPENETWORK_TYPE - can be one of : all - All network type res - Residential dc - Datacenter mobile - Mobile   Sample Response: {"status":true}   Shell curl"https://brightdata.com/api/network_status/NETWOR...

  • 获取城市和国家

    API endpoint: GET /api/cities Parameter: country="COUNTRY_CODE" Sample Response:[{"c_id":"US","region":"Texas","r_id":"TX","country":"United States","name":"Cherokee"}]   Shell curl"https://brightdata.com/api/cities?country=US" -H "Authorization: Bearer...

  • 获取某个国家的城市的可用静态代理网络

    API endpoint: GET /api/zone/static/cities Parameters: country [string] (required) - Country pool_ip_type [string] - Network type, optional values : dc - Datacenter (default) static_res - ISP   Sample Response: ["us-chicago", "us-ashburn", "us-sio...

代理管理器 API

  • 获取代理管理器版本

    API endpoint: GET /api/version Sample Response: {"version":"1.280.385","argv":""}   Shell curl"http://127.0.0.1:22999/api/version" Node.js #!/usr/bin/env noderequire('request-promise')({ url: 'http://127.0.0.1:22999/api/version' }).then(function(data){...

  • 获取最新的代理管理器版本

    API endpoint: GET /api/last_version Sample Response: {"version": "1.280.385","newer": false,"versions": [{"ver": "1.280.385","type": "stable","changes": [{"type": "star","text": "Add render option for unblocker and serp zones"}]}]}   Shell curl"http://1...

  • 获取目前运行的NodeJS版本

    API endpoint: GET /api/node_version Sample Response: {"current":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"v12.16.1\n","major":12,"minor":16,"patch":1,"prerelease":[],"build":[],"version":"12.16.1"},"satisfied":true,"recom...

  • 为基于令牌的身份验证生成令牌

    API endpoint: GET /api/gen_token Sample Response: {"token":"RZD9vaQQaL6En7"}   Shell curl"http://127.0.0.1:22999/api/gen_token" Node.js #!/usr/bin/env noderequire('request-promise')({ url: 'http://127.0.0.1:22999/api/gen_token' }).then(function(data){ ...

  • 白名单IP

    API endpoint: POST /api/add_wip Authorization: TOKEN - Token should be generated using Generate token API POST body ip="1.2.1.2"   Shell curl "http://127.0.0.1:22999/api/add_wip" -H "Authorization: TOKEN" -H "Content-Type: application/json" -d "{\"...

  • 将IP白名单化以访问UI

    API endpoint: POST /api/add_whitelist_ip POST body ip="1.2.1.2"   Shell curl "http://127.0.0.1:22999/api/add_whitelist_ip"-H "Content-Type: application/json" -d "{\"ip\":\"1.2.1.2\"}" Node.js #!/usr/bin/env noderequire('request-promise')({ method:...

数据采集器 API

  • 入门

    The Data Collector product offers a JSON API to control and inspect your data collectors programmatically. Getting started: Signup (or login) to our control panel Insert target URL (website to collect data from) or choose a ready-made template Set up t...

  • 触发批量采集

    API endpoint: POST /dca/trigger?collector={ID_COLLECTOR} Parameters : collector={ID_COLLECTOR} - A unique identification of collector version=dev - (Optional) Trigger the development version of the collector name={human_name} - (Optional) A human read...

  • 接受批量数据

    API endpoint: GET /dca/dataset?id={id_dataset} Parameters : id={id_dataset} – An unique identification of data set. Payload : Header: Authorization Bearer Key -H "Authorization: Bearer API_TOKEN" Sample Response : Waiting for dataset to be re...

  • 触发实时采集

    API endpoint: POST /dca/trigger_immediate?collector={ID_COLLECTOR} Parameters : collector={ID_COLLECTOR} - A unique identification of collector version=dev - (Optional) Trigger the development version of the collector name={human_name} - (Optional) A ...

  • 从实时数据采集器收集数据

    API endpoint: GET /dca/get_result?response_id={ID_RESPONSE} Parameters : response_id={ID_RESPONSE} – An unique identification of response Payload : Header: Authorization Bearer Key -H "Authorization: Bearer API_TOKEN" Sample Response : { "...

  • 在请求级别选择交付类型

    Instead of creating duplicate collectors for each delivery type, you can choose a delivery type per job using API.   Step 1. Ensure that your collector is updated to the latest version to improve success rate.   Step 2. Set a delivery type to Batch.  ...