Skip to content

Commit aeca662

Browse files
committed
update API docs and remove broken marketplace endpoints
1 parent 7d3760b commit aeca662

29 files changed

Lines changed: 874 additions & 927 deletions

File tree

astro.config.mjs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -504,29 +504,6 @@ export default defineConfig({
504504
},
505505
],
506506
},
507-
{
508-
label: 'Marketplace',
509-
collapsed: true,
510-
translations: {
511-
'zh-CN': '市场',
512-
},
513-
items: [
514-
{
515-
label: 'Search Scrapers',
516-
slug: 'api/marketplace/search',
517-
translations: {
518-
'zh-CN': '搜索爬虫',
519-
},
520-
},
521-
{
522-
label: 'Scraper Details',
523-
slug: 'api/marketplace/details',
524-
translations: {
525-
'zh-CN': '爬虫详情',
526-
},
527-
},
528-
],
529-
},
530507
{
531508
label: 'Account',
532509
collapsed: true,

src/content/docs/api/account/info.md

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,21 @@ sidebar:
55
order: 10
66
---
77

8-
**Method:** `GET`
8+
**Method:** `POST`
99

1010
**Endpoint:** `/api/v1/account/info`
1111

12+
Send the request body with **Content-Type: application/json**.
13+
14+
## Request Example
15+
16+
```bash
17+
curl -X POST "https://openapi.coreclaw.com/api/v1/account/info" \
18+
-H "api-key: YOUR_API_KEY" \
19+
-H "content-type: application/json" \
20+
--data "{}"
21+
```
22+
1223
## Response Example
1324

1425
```json
@@ -18,18 +29,18 @@ sidebar:
1829
"data": {
1930
"balance": "10122.5547",
2031
"traffic": 178194757135,
21-
"traffic_expires_at": 1775267018
32+
"traffic_expiration_at": 1775267018
2233
}
2334
}
2435
```
2536

2637
#### Response Fields
2738

28-
| Parameter | Example Value | Type | Description |
29-
| ------------------ | ------------- | ------- | ---------------------------------------------- |
30-
| code | 0 | Integer | [View help](/api/#global-status-codes) |
31-
| message | success | String | Response message |
32-
| data | - | Object | Response payload |
33-
| └─ balance | 10122.5547 | String | Account balance ($) |
34-
| └─ traffic | 178194757135 | Integer | Traffic quota in bytes |
35-
| └─ traffic_expires_at | 1775267018 | Integer | Traffic expiration time (timestamp, seconds) |
39+
| Parameter | Example Value | Type | Description |
40+
| ------------------------ | ------------- | ------- | -------------------------------------------- |
41+
| code | 0 | Integer | [View help](/api/#global-status-codes) |
42+
| message | success | String | Response message |
43+
| data | - | Object | Response payload |
44+
| └─ balance | 10122.5547 | String | Account balance ($) |
45+
| └─ traffic | 178194757135 | Integer | Consumed traffic (bytes) |
46+
| └─ traffic_expiration_at | 1775267018 | Integer | Traffic expiration time (timestamp, seconds) |

src/content/docs/api/index.md

Lines changed: 29 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -13,53 +13,45 @@ https://openapi.coreclaw.com
1313

1414
## Header Parameters
1515

16-
| Parameter Name | Example Value | Type | Required | Description |
17-
| -------------- | ------------------- | ------ | -------- | ----------- |
18-
| api-key | <YOUR_API_KEY> | string | Yes | Your API key for authentication |
19-
| content-type | application/json | string | Yes | Request content type |
16+
| Parameter Name | Example Value | Type | Required | Description |
17+
| -------------- | ---------------- | ------ | -------- | ----------- |
18+
| api-key | <YOUR_API_KEY> | string | Yes | Your API key for authentication |
19+
| content-type | application/json | string | Yes | Request content type |
2020

2121
## Global Status Codes
2222

2323
Each API request may return a success code or an error code. You can use these codes to debug requests and identify issues.
2424

25-
| CODE | Description |
26-
| ----- | --------------------------- |
27-
| 0 | Success |
28-
| 5000 | Internal server error |
29-
| 4000 | Invalid request parameters |
30-
| 4010 | Unauthorized access |
31-
| 4040 | Resource not found |
32-
| 4290 | Rate limit exceeded |
33-
| 10001 | User does not exist |
34-
| 10002 | User is disabled |
35-
| 20001 | Invalid API key |
36-
| 20002 | API key expired |
37-
| 30001 | Insufficient balance |
38-
| 30002 | Insufficient traffic quota |
39-
| 50001 | Worker does not exist |
40-
| 50002 | Worker execution failed |
41-
| 50003 | Worker version unavailable |
42-
| 60001 | Task does not exist |
43-
| 70001 | Run record does not exist |
44-
| 70002 | Run abort failed |
25+
| CODE | Description |
26+
| ----- | -------------------------- |
27+
| 0 | Success |
28+
| 5000 | Internal server error |
29+
| 4000 | Invalid request parameters |
30+
| 4010 | Unauthorized access |
31+
| 4040 | Resource not found |
32+
| 4290 | Rate limit exceeded |
33+
| 10001 | User does not exist |
34+
| 10002 | User is disabled |
35+
| 20001 | Invalid API key |
36+
| 20002 | API key expired |
37+
| 30001 | Insufficient balance |
38+
| 30002 | Insufficient traffic quota |
39+
| 50001 | Worker does not exist |
40+
| 50002 | Worker execution failed |
41+
| 50003 | Worker version unavailable |
42+
| 60001 | Task does not exist |
43+
| 70001 | Run record does not exist |
44+
| 70002 | Run abort failed |
4545

4646
## Authentication
4747

48-
All API requests require authentication using your API key. You can find your API key in your account settings.
49-
50-
### Getting Your API Key
51-
52-
1. Log in to your CoreClaw account
53-
2. Navigate to Account Settings
54-
3. Find your API key in the API section
55-
4. Copy and use it in your requests
48+
All API requests require authentication using your API key. Include it in the request header of every API call.
5649

5750
### Using the API Key
5851

59-
Include your API key in the header of every request:
60-
6152
```bash
62-
curl -X GET "https://openapi.coreclaw.com/api/v1/account/info" \
53+
curl -X POST "https://openapi.coreclaw.com/api/v1/account/info" \
6354
-H "api-key: YOUR_API_KEY" \
64-
-H "content-type: application/json"
65-
```
55+
-H "content-type: application/json" \
56+
--data "{}"
57+
```

src/content/docs/api/marketplace/details.md

Lines changed: 0 additions & 77 deletions
This file was deleted.

src/content/docs/api/marketplace/search.md

Lines changed: 0 additions & 61 deletions
This file was deleted.

src/content/docs/api/run/detail.md

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,25 @@ sidebar:
55
order: 2
66
---
77

8-
**Method:** `GET`
8+
**Method:** `POST`
99

10-
**Endpoint:** `/api/v1/runs/{run_slug}/status`
10+
**Endpoint:** `/api/v1/run/detail`
1111

12-
## Path Parameters
12+
Send the request body with **Content-Type: application/json**.
1313

14-
| Parameter | Required | Description |
15-
| --------- | -------- | --------------------- |
16-
| run_slug | Yes | Unique run identifier |
14+
## Request Example
15+
16+
```json
17+
{
18+
"run_slug": "YOUR_RUN_SLUG"
19+
}
20+
```
21+
22+
#### Parameters
23+
24+
| Parameter | Example | Type | Required | Description |
25+
| --------- | ------------- | ------ | -------- | --------------------- |
26+
| run_slug | YOUR_RUN_SLUG | String | Yes | Unique run identifier |
1727

1828
## Response Example
1929

@@ -27,11 +37,11 @@ sidebar:
2737
"slug": "01KKJYJ4HH0R9K7XD856MAE1WH",
2838
"actors_title": "News Collection 20260305",
2939
"actors_slug": "01KJXYJ7KCHXM0PDZHQD5293XE",
30-
"result_count": 4,
31-
"cost": "0.0217",
40+
"results": 4,
41+
"usage": "0.0217",
3242
"started_at": 1773383784,
3343
"finished_at": 0,
34-
"duration_seconds": 0,
44+
"duration": 0,
3545
"origin": "api",
3646
"traffic": 0,
3747
"version": "v1.0.1"
@@ -41,24 +51,24 @@ sidebar:
4151

4252
#### Response Fields
4353

44-
| Parameter | Example | Type | Description |
45-
| --------------- | -------------------------- | ------- | -------------------------------------------------------------------- |
46-
| code | 0 | Integer | Global status code |
47-
| message | success | String | Response message |
48-
| data | - | Object | Response payload |
49-
| status | 3 | Integer | Run status: 1 Ready, 2 Running, 3 Succeeded, 4 Failed, 5 Aborting |
50-
| err_msg | - | String | Error message |
51-
| slug | 01KKJYJ4HH0R9K7XD856MAE1WH | String | Unique run identifier |
52-
| actors_title | News Collection 20260305 | String | Worker title |
53-
| actors_slug | 01KJXYJ7KCHXM0PDZHQD5293XE | String | Unique Worker identifier |
54-
| result_count | 4 | Integer | Number of collected results |
55-
| cost | 0.0217 | String | Device usage cost in USD |
56-
| started_at | 1773383784 | Integer | Start timestamp |
57-
| finished_at | 0 | Integer | Finish timestamp |
58-
| duration_seconds | 0 | Integer | Execution duration in seconds |
59-
| origin | api | String | Run source: `api` or `web` |
60-
| traffic | 0 | Integer | Traffic usage in bytes |
61-
| version | v1.0.1 | String | Worker version |
54+
| Parameter | Example | Type | Description |
55+
| ------------ | -------------------------- | ------- | ----------------------------------------------------------------- |
56+
| code | 0 | Integer | Global status code |
57+
| message | success | String | Response message |
58+
| data | - | Object | Response payload |
59+
| status | 3 | Integer | Run status: 1 Ready, 2 Running, 3 Succeeded, 4 Failed, 5 Aborted |
60+
| err_msg | - | String | Error message |
61+
| slug | 01KKJYJ4HH0R9K7XD856MAE1WH | String | Unique run identifier |
62+
| actors_title | News Collection 20260305 | String | Worker title |
63+
| actors_slug | 01KJXYJ7KCHXM0PDZHQD5293XE | String | Unique Worker identifier |
64+
| results | 4 | Integer | Number of collected results |
65+
| usage | 0.0217 | String | Device usage cost in USD |
66+
| started_at | 1773383784 | Integer | Start timestamp |
67+
| finished_at | 0 | Integer | Finish timestamp |
68+
| duration | 0 | Integer | Execution duration in seconds |
69+
| origin | api | String | Run source: `api` or `web` |
70+
| traffic | 0 | Integer | Traffic usage in bytes |
71+
| version | v1.0.1 | String | Worker version |
6272

6373
## Error Response
6474

0 commit comments

Comments
 (0)