-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi-web-scraping.json
More file actions
237 lines (237 loc) · 8.57 KB
/
Copy pathopenapi-web-scraping.json
File metadata and controls
237 lines (237 loc) · 8.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
{
"openapi": "3.1.0",
"info": {
"title": "ScrapeBadger Web Scraping API",
"version": "1.0.0",
"description": "Web scraping API with anti-bot bypass, JS rendering, and AI extraction."
},
"servers": [
{
"url": "https://scrapebadger.com",
"description": "Production"
}
],
"security": [
{
"apiKeyAuth": []
}
],
"paths": {
"/v1/web/scrape": {
"post": {
"operationId": "scrapeUrl",
"summary": "Scrape URL",
"description": "Scrape a webpage and return its content as HTML, Markdown, or plain text.",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["url"],
"properties": {
"url": {
"type": "string",
"description": "The URL to scrape. Must be a valid HTTP or HTTPS URL."
},
"engine": {
"type": "string",
"default": "auto",
"enum": ["auto", "browser"],
"description": "Scraping engine tier to use."
},
"format": {
"type": "string",
"default": "html",
"enum": ["html", "markdown", "text"],
"description": "Output format for the scraped content."
},
"render_js": {
"type": "boolean",
"default": false,
"description": "Force JavaScript rendering."
},
"wait_for": {
"type": "string",
"description": "CSS selector or XPath to wait for before extracting."
},
"wait_timeout": {
"type": "integer",
"default": 30000,
"description": "Max wait time in ms for wait_for selector."
},
"wait_after_load": {
"type": "integer",
"description": "Additional ms to wait after page load."
},
"js_scenario": {
"type": "array",
"items": {
"type": "object"
},
"description": "Browser actions to perform before extracting."
},
"session_id": {
"type": "string",
"description": "Persist cookies and state across requests."
},
"retry_count": {
"type": "integer",
"default": 3,
"description": "Max retry attempts on blocking detection."
},
"retry_on_block": {
"type": "boolean",
"default": true,
"description": "Auto-retry on blocking page detection."
},
"country": {
"type": "string",
"description": "ISO 3166-1 alpha-2 country code for proxy geo-targeting."
},
"custom_headers": {
"type": "object",
"description": "Additional HTTP headers for the target request."
},
"screenshot": {
"type": "boolean",
"default": false,
"description": "Capture a full-page PNG screenshot."
},
"video": {
"type": "boolean",
"default": false,
"description": "Record browser session as animated GIF (+3 credits)."
},
"anti_bot": {
"type": "boolean",
"default": false,
"description": "Attempt anti-bot bypass when blocking detected."
},
"escalate": {
"type": "boolean",
"default": false,
"description": "Allow auto-escalation to stronger engines."
},
"max_cost": {
"type": "integer",
"description": "Maximum credits budget for this request."
},
"ai_extract": {
"type": "boolean",
"default": false,
"description": "Run AI extraction on scraped content."
},
"ai_prompt": {
"type": "string",
"description": "Natural language instruction for AI extraction."
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successful scrape",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": { "type": "boolean" },
"url": { "type": "string" },
"status_code": { "type": "integer" },
"content": { "type": "string" },
"format": { "type": "string" },
"engine_used": { "type": "string" },
"credits_used": { "type": "integer" },
"duration_ms": { "type": "integer" },
"retries_used": { "type": "integer" },
"content_length": { "type": "integer" },
"screenshot_url": { "type": "string", "nullable": true },
"video_url": { "type": "string", "nullable": true },
"headers": { "type": "object" },
"blocking_detected": { "type": "boolean" },
"blocking_details": { "type": "object", "nullable": true },
"antibot_systems": { "type": "array" },
"captcha_systems": { "type": "array" },
"anti_bot_solved": { "type": "boolean" },
"solver_used": { "type": "string", "nullable": true },
"ai_extraction": { "nullable": true },
"ai_model": { "type": "string", "nullable": true },
"ai_error": { "type": "string", "nullable": true }
}
}
}
}
}
}
}
},
"/v1/web/detect": {
"post": {
"operationId": "detectProtection",
"summary": "Detect Protection",
"description": "Analyze a URL for anti-bot and CAPTCHA systems without performing a full scrape.",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["url"],
"properties": {
"url": {
"type": "string",
"description": "The URL to analyze."
},
"timeout": {
"type": "integer",
"default": 15000,
"description": "Request timeout in milliseconds."
},
"country": {
"type": "string",
"description": "ISO 3166-1 alpha-2 country code for proxy geo-targeting."
}
}
}
}
}
},
"responses": {
"200": {
"description": "Detection result",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"url": { "type": "string" },
"antibot_systems": { "type": "array" },
"captcha_systems": { "type": "array" },
"is_blocked": { "type": "boolean" },
"blocking_type": { "type": "string", "nullable": true },
"recommendation": { "type": "string", "nullable": true },
"credits_used": { "type": "integer" },
"duration_ms": { "type": "integer" }
}
}
}
}
}
}
}
}
},
"components": {
"securitySchemes": {
"apiKeyAuth": {
"type": "apiKey",
"in": "header",
"name": "x-api-key"
}
}
}
}