此页内容

独享实例API

captchaRun

382字约1分钟

2024-05-21

获取实例信息

请求方式: GET 路径: /v2/instances/{实例 ID}

请求样例

GET https://api.captcha.run/captcha/instances/00000000-0000-0000-0000-000000000000

Authorization: Bearer 00000000-0000-0000-0000-000000000000 // 用户 Token

CURL

curl -X GET "https://api.captcha.run/captcha/instances/00000000-0000-0000-0000-000000000000" \
     -H "Authorization: Bearer 00000000-0000-0000-0000-000000000000"

Python

import requests

headers = {
    'Authorization': 'Bearer 00000000-0000-0000-0000-000000000000',
}

response = requests.get('https://api.captcha.run/captcha/instances/00000000-0000-0000-0000-000000000000', headers=headers)

返回样例

{
  "_id": "c6bbdf5a-7552-4863-ab99-8ee03a7f8b80",
  "userId": "b9056f79-bfcf-42d7-8d85-bd2b1b1c9876",
  "region": "us-east4",
  "numInstances": 1,
  "containerImage": "us-docker.pkg.dev/captchaRun/ocr/cv-runtime@sha256:eef4dba0e6f88a7a67fbe5f3261acf342a101d07a6e73d0e8ed5e123f68aaa20",
  "status": "terminated",
  "price": "192",
  "scheduled": "2022-04-23T08:19:38.951Z",
  "expired": "2022-04-23T16:19:38.951Z",
  "created": "2022-04-23T08:19:38.963Z",
  "cloudRunId": "exclusive-c6bbdf5a-7552-4863-ab99-8ee03a7f8b80",
  "description": "实例已终止",
  "url": "https://exclusive-c6bbdf5a-7552-4863-ab99-8ee03a7f8b80-3po2mc35ha-uk.a.run.app",
  "developerId": "b487184f-9904-4554-adf0-176bca60b852"
}

独享服务器绑定开发者

绑定开发者后可获得分成收益

请求方式: PUT 路径: /v2/instances/{实例 ID}/developer

参数名是否必须说明
developerId邀请码

请求样例

PUT https://api.captcha.run/captcha/instances/00000000-0000-0000-0000-000000000000/developer

Content-Type: application/json
Authorization: Bearer 00000000-0000-0000-0000-000000000000 // 用户 Token

{
  "developerId": "00000000-0000-0000-0000-000000000000"
}

CURL

curl -X PUT "https://api.captcha.run/captcha/instances/00000000-0000-0000-0000-000000000000/developer" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer 00000000-0000-0000-0000-000000000000" \
     -d '{
        "developerId": "00000000-0000-0000-0000-000000000000"
    }'

Python

import requests

headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer 00000000-0000-0000-0000-000000000000',
}

json_data = {
    'developerId': '00000000-0000-0000-0000-000000000000',
}

response = requests.put(
    'https://api.captcha.run/captcha/instances/00000000-0000-0000-0000-000000000000/developer',
    headers=headers,
    json=json_data,
)

返回样例

状态码: 204: 成功, 其他: 见返回