You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sources/api/getting-started.mdx
+39-13Lines changed: 39 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,7 @@ Expected response codes:
54
54
55
55
## Basic workflow
56
56
57
-
A most common workflow involving Apify API consists of the following steps:
57
+
The most common workflow involving Apify API consists of the following steps:
58
58
59
59
1. Running an Actor.
60
60
1. Retrieving the results.
@@ -63,10 +63,10 @@ A most common workflow involving Apify API consists of the following steps:
63
63
64
64
#### Synchronously
65
65
66
-
For shorter runs where you need immiediate results:
66
+
For shorter runs where you need immediate results:
67
67
68
68
```http title="Endpoint"
69
-
POST https://api.apify.com/v2/acts/{actorId}/run-sync
69
+
POST https://api.apify.com/v2/acts/:actorId/run-sync
70
70
```
71
71
72
72
Expected response codes:
@@ -77,12 +77,12 @@ Expected response codes:
77
77
78
78
#### Asynchronously
79
79
80
+
For longer-running operations or when you don't need immediate results.
81
+
80
82
```http title="Endpoint"
81
-
POST https://api.apify.com/v2/acts/{actorId}/runs
83
+
POST https://api.apify.com/v2/acts/:actorId/runs
82
84
```
83
85
84
-
The request body is the same as for asynchronous runs, but the response will include the complete results once the Actor finishes.
85
-
86
86
Expected response codes:
87
87
88
88
*`201`
@@ -94,7 +94,7 @@ Expected response codes:
94
94
Most Actors store their results in a dataset:
95
95
96
96
```http title="Endpoint"
97
-
GET https://api.apify.com/v2/datasets/{datasetId}/items
97
+
GET https://api.apify.com/v2/datasets/:datasetId/items
98
98
```
99
99
100
100
Optional query parameters:
@@ -109,14 +109,14 @@ Optional query parameters:
109
109
*`limit=100` (number of items to retrieve)
110
110
*`offset=0` (pagination offset)
111
111
112
-
Expected code responses:
112
+
Expected response codes:
113
113
114
114
*`200`
115
115
116
116
#### From a Key-value store
117
117
118
118
```http title="Endpoint"
119
-
GET https://api.apify.com/v2/key-value-stores/{storeId}/records/{recordKey}
119
+
GET https://api.apify.com/v2/key-value-stores/:storeId/records/:recordKey
120
120
```
121
121
122
122
Expected response codes:
@@ -134,7 +134,7 @@ You can get a log for a specific run or build of an Actor.
134
134
GET https://api.apify.com/v2/logs/:buildOrRunId
135
135
```
136
136
137
-
Expected code responses:
137
+
Expected response codes:
138
138
139
139
*`200`
140
140
@@ -144,7 +144,7 @@ Expected code responses:
144
144
GET https://api.apify.com/v2/actor-runs/:runId
145
145
```
146
146
147
-
Expected response code:
147
+
Expected response codes:
148
148
149
149
*`200`
150
150
@@ -156,7 +156,7 @@ To store your own data in a Dataset:
156
156
POST https://api.apify.com/v2/datasets/:datasetId/items
157
157
```
158
158
159
-
If any of the items received by the API fails the validation, whole request is discarded.
159
+
If any item in the request fails validation, the entire request will be rejected.
160
160
161
161
Expected response codes:
162
162
@@ -168,7 +168,7 @@ Expected response codes:
168
168
To store your own data in a Key-value store:
169
169
170
170
```http title="Endpoint"
171
-
PUT https://api.apify.com/v2/key-value-stores/{storeId}/records/{recordKey}
171
+
PUT https://api.apify.com/v2/key-value-stores/:storeId/records/:recordKey
172
172
```
173
173
174
174
Include your data in the request body and set the appropriate `Content-Type` header.
@@ -177,6 +177,32 @@ Expected response codes:
177
177
178
178
*`201`
179
179
180
+
## HTTP Status Code Descriptions
181
+
182
+
### `200` OK
183
+
184
+
The request has succeeded.
185
+
186
+
### `201` Created
187
+
188
+
The request has been fulfilled and a new resource has been created.
189
+
190
+
### `302` Found
191
+
192
+
A redirection response indicating that the requested resource has been temporarily moved to a different URL.
193
+
194
+
### `400` Bad Request
195
+
196
+
The server cannot process the request due to client error, such as request syntax, invalid request parameters, or invalid data format. This occurs when:
197
+
198
+
* The request body contains invalid data
199
+
* Required parameters are missing
200
+
* Data validation fails for Dataset items
201
+
202
+
### `408` Request Timeout
203
+
204
+
The server timed out waiting for the request to complete.
205
+
180
206
## Next steps
181
207
182
208
* Explore more advanced API endpoints in our full [API reference](/api/v2).
0 commit comments