![Facebook ad library scraper avatar](https://images.apifyusercontent.com/T2bTOZfzeSw-LQg79D1q5IhrugqFgVEiZTLJGGNlwRc/rs:fill:250:250/cb:1/aHR0cHM6Ly9hcGlmeS1pbWFnZS11cGxvYWRzLXByb2QuczMuYW1hem9uYXdzLmNvbS9YdGFXRmhidGZ4eXpxckZtZC9aaEcyTXJNdThMTXBTNktrcS1mYWNlYm9vay5qcGVn.webp)
Facebook ad library scraper
Pay $0.75 for 1,000 ads
![Facebook ad library scraper](https://images.apifyusercontent.com/T2bTOZfzeSw-LQg79D1q5IhrugqFgVEiZTLJGGNlwRc/rs:fill:250:250/cb:1/aHR0cHM6Ly9hcGlmeS1pbWFnZS11cGxvYWRzLXByb2QuczMuYW1hem9uYXdzLmNvbS9YdGFXRmhidGZ4eXpxckZtZC9aaEcyTXJNdThMTXBTNktrcS1mYWNlYm9vay5qcGVn.webp)
Facebook ad library scraper
Pay $0.75 for 1,000 ads
Scrape facebook ads search and ads run by facebook pages - Fast and lightweight
You can access the Facebook ad library scraper programmatically from your own applications by using the Apify API. You can choose the language preference from below. To use the Apify API, youβll need an Apify account and your API token, found in Integrations settings in Apify Console.
1{
2 "openapi": "3.0.1",
3 "info": {
4 "version": "2.1",
5 "x-build-id": "2ZsNRaIdb2AO8w3B6"
6 },
7 "servers": [
8 {
9 "url": "https://api.apify.com/v2"
10 }
11 ],
12 "paths": {
13 "/acts/curious_coder~facebook-ads-library-scraper/run-sync-get-dataset-items": {
14 "post": {
15 "operationId": "run-sync-get-dataset-items-curious_coder-facebook-ads-library-scraper",
16 "x-openai-isConsequential": false,
17 "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
18 "tags": [
19 "Run Actor"
20 ],
21 "requestBody": {
22 "required": true,
23 "content": {
24 "application/json": {
25 "schema": {
26 "$ref": "#/components/schemas/inputSchema"
27 }
28 }
29 }
30 },
31 "parameters": [
32 {
33 "name": "token",
34 "in": "query",
35 "required": true,
36 "schema": {
37 "type": "string"
38 },
39 "description": "Enter your Apify token here"
40 }
41 ],
42 "responses": {
43 "200": {
44 "description": "OK"
45 }
46 }
47 }
48 },
49 "/acts/curious_coder~facebook-ads-library-scraper/runs": {
50 "post": {
51 "operationId": "runs-sync-curious_coder-facebook-ads-library-scraper",
52 "x-openai-isConsequential": false,
53 "summary": "Executes an Actor and returns information about the initiated run in response.",
54 "tags": [
55 "Run Actor"
56 ],
57 "requestBody": {
58 "required": true,
59 "content": {
60 "application/json": {
61 "schema": {
62 "$ref": "#/components/schemas/inputSchema"
63 }
64 }
65 }
66 },
67 "parameters": [
68 {
69 "name": "token",
70 "in": "query",
71 "required": true,
72 "schema": {
73 "type": "string"
74 },
75 "description": "Enter your Apify token here"
76 }
77 ],
78 "responses": {
79 "200": {
80 "description": "OK",
81 "content": {
82 "application/json": {
83 "schema": {
84 "$ref": "#/components/schemas/runsResponseSchema"
85 }
86 }
87 }
88 }
89 }
90 }
91 },
92 "/acts/curious_coder~facebook-ads-library-scraper/run-sync": {
93 "post": {
94 "operationId": "run-sync-curious_coder-facebook-ads-library-scraper",
95 "x-openai-isConsequential": false,
96 "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
97 "tags": [
98 "Run Actor"
99 ],
100 "requestBody": {
101 "required": true,
102 "content": {
103 "application/json": {
104 "schema": {
105 "$ref": "#/components/schemas/inputSchema"
106 }
107 }
108 }
109 },
110 "parameters": [
111 {
112 "name": "token",
113 "in": "query",
114 "required": true,
115 "schema": {
116 "type": "string"
117 },
118 "description": "Enter your Apify token here"
119 }
120 ],
121 "responses": {
122 "200": {
123 "description": "OK"
124 }
125 }
126 }
127 }
128 },
129 "components": {
130 "schemas": {
131 "inputSchema": {
132 "type": "object",
133 "required": [
134 "urls"
135 ],
136 "properties": {
137 "urls": {
138 "title": "π URLs",
139 "type": "array",
140 "description": "List of facebook ads search URLs or Page URLs to scrape ads from",
141 "items": {
142 "type": "object",
143 "required": [
144 "url"
145 ],
146 "properties": {
147 "url": {
148 "type": "string",
149 "title": "URL of a web page",
150 "format": "uri"
151 }
152 }
153 }
154 },
155 "scrapeAdDetails": {
156 "title": "Scrape ad details",
157 "type": "boolean",
158 "description": "Enable this option to scrape ads details such as EU Reach info"
159 },
160 "count": {
161 "title": "#οΈβ£ Total number of records required",
162 "type": "integer",
163 "description": "Leave this field empty if you want to scrape all items."
164 },
165 "scrapePageAds.activeStatus": {
166 "title": "Filter ads by active status",
167 "enum": [
168 "all",
169 "active",
170 "inactive"
171 ],
172 "type": "string",
173 "description": "",
174 "default": "all"
175 },
176 "period": {
177 "title": "Date range",
178 "enum": [
179 "",
180 "last24h",
181 "last7d",
182 "last30d"
183 ],
184 "type": "string",
185 "description": "Search ads in given date range (uses ads search filters)",
186 "default": ""
187 }
188 }
189 },
190 "runsResponseSchema": {
191 "type": "object",
192 "properties": {
193 "data": {
194 "type": "object",
195 "properties": {
196 "id": {
197 "type": "string"
198 },
199 "actId": {
200 "type": "string"
201 },
202 "userId": {
203 "type": "string"
204 },
205 "startedAt": {
206 "type": "string",
207 "format": "date-time",
208 "example": "2025-01-08T00:00:00.000Z"
209 },
210 "finishedAt": {
211 "type": "string",
212 "format": "date-time",
213 "example": "2025-01-08T00:00:00.000Z"
214 },
215 "status": {
216 "type": "string",
217 "example": "READY"
218 },
219 "meta": {
220 "type": "object",
221 "properties": {
222 "origin": {
223 "type": "string",
224 "example": "API"
225 },
226 "userAgent": {
227 "type": "string"
228 }
229 }
230 },
231 "stats": {
232 "type": "object",
233 "properties": {
234 "inputBodyLen": {
235 "type": "integer",
236 "example": 2000
237 },
238 "rebootCount": {
239 "type": "integer",
240 "example": 0
241 },
242 "restartCount": {
243 "type": "integer",
244 "example": 0
245 },
246 "resurrectCount": {
247 "type": "integer",
248 "example": 0
249 },
250 "computeUnits": {
251 "type": "integer",
252 "example": 0
253 }
254 }
255 },
256 "options": {
257 "type": "object",
258 "properties": {
259 "build": {
260 "type": "string",
261 "example": "latest"
262 },
263 "timeoutSecs": {
264 "type": "integer",
265 "example": 300
266 },
267 "memoryMbytes": {
268 "type": "integer",
269 "example": 1024
270 },
271 "diskMbytes": {
272 "type": "integer",
273 "example": 2048
274 }
275 }
276 },
277 "buildId": {
278 "type": "string"
279 },
280 "defaultKeyValueStoreId": {
281 "type": "string"
282 },
283 "defaultDatasetId": {
284 "type": "string"
285 },
286 "defaultRequestQueueId": {
287 "type": "string"
288 },
289 "buildNumber": {
290 "type": "string",
291 "example": "1.0.0"
292 },
293 "containerUrl": {
294 "type": "string"
295 },
296 "usage": {
297 "type": "object",
298 "properties": {
299 "ACTOR_COMPUTE_UNITS": {
300 "type": "integer",
301 "example": 0
302 },
303 "DATASET_READS": {
304 "type": "integer",
305 "example": 0
306 },
307 "DATASET_WRITES": {
308 "type": "integer",
309 "example": 0
310 },
311 "KEY_VALUE_STORE_READS": {
312 "type": "integer",
313 "example": 0
314 },
315 "KEY_VALUE_STORE_WRITES": {
316 "type": "integer",
317 "example": 1
318 },
319 "KEY_VALUE_STORE_LISTS": {
320 "type": "integer",
321 "example": 0
322 },
323 "REQUEST_QUEUE_READS": {
324 "type": "integer",
325 "example": 0
326 },
327 "REQUEST_QUEUE_WRITES": {
328 "type": "integer",
329 "example": 0
330 },
331 "DATA_TRANSFER_INTERNAL_GBYTES": {
332 "type": "integer",
333 "example": 0
334 },
335 "DATA_TRANSFER_EXTERNAL_GBYTES": {
336 "type": "integer",
337 "example": 0
338 },
339 "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
340 "type": "integer",
341 "example": 0
342 },
343 "PROXY_SERPS": {
344 "type": "integer",
345 "example": 0
346 }
347 }
348 },
349 "usageTotalUsd": {
350 "type": "number",
351 "example": 0.00005
352 },
353 "usageUsd": {
354 "type": "object",
355 "properties": {
356 "ACTOR_COMPUTE_UNITS": {
357 "type": "integer",
358 "example": 0
359 },
360 "DATASET_READS": {
361 "type": "integer",
362 "example": 0
363 },
364 "DATASET_WRITES": {
365 "type": "integer",
366 "example": 0
367 },
368 "KEY_VALUE_STORE_READS": {
369 "type": "integer",
370 "example": 0
371 },
372 "KEY_VALUE_STORE_WRITES": {
373 "type": "number",
374 "example": 0.00005
375 },
376 "KEY_VALUE_STORE_LISTS": {
377 "type": "integer",
378 "example": 0
379 },
380 "REQUEST_QUEUE_READS": {
381 "type": "integer",
382 "example": 0
383 },
384 "REQUEST_QUEUE_WRITES": {
385 "type": "integer",
386 "example": 0
387 },
388 "DATA_TRANSFER_INTERNAL_GBYTES": {
389 "type": "integer",
390 "example": 0
391 },
392 "DATA_TRANSFER_EXTERNAL_GBYTES": {
393 "type": "integer",
394 "example": 0
395 },
396 "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
397 "type": "integer",
398 "example": 0
399 },
400 "PROXY_SERPS": {
401 "type": "integer",
402 "example": 0
403 }
404 }
405 }
406 }
407 }
408 }
409 }
410 }
411 }
412}
Facebook ad library scraper OpenAPI definition
OpenAPI is a standard for designing and describing RESTful APIs, allowing developers to define API structure, endpoints, and data formats in a machine-readable way. It simplifies API development, integration, and documentation.
OpenAPI is effective when used with AI agents and GPTs by standardizing how these systems interact with various APIs, for reliable integrations and efficient communication.
By defining machine-readable API specifications, OpenAPI allows AI models like GPTs to understand and use varied data sources, improving accuracy. This accelerates development, reduces errors, and provides context-aware responses, making OpenAPI a core component for AI applications.
You can download the OpenAPI definitions for Facebook ad library scraper from the options below:
If youβd like to learn more about how OpenAPI powers GPTs, read our blog post.
You can also check out our other API clients:
Actor Metrics
883 monthly users
-
88 stars
>99% runs succeeded
4.6 days response time
Created in Aug 2023
Modified 19 days ago