Puppeteer Scraper avatar

Puppeteer Scraper

Try for free

No credit card required

Go to Store
Puppeteer Scraper

Puppeteer Scraper

apify/puppeteer-scraper
Try for free

No credit card required

Developer
Maintained by Community

Actor Metrics

  • 2 monthly users

  • 1 bookmark

  • >99% runs succeeded

  • Created in Apr 2019

  • Modified 6 years ago

Categories

You can access the Puppeteer 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": "0.0",
5    "x-build-id": "rxfd8QspPPs335bLE"
6  },
7  "servers": [
8    {
9      "url": "https://api.apify.com/v2"
10    }
11  ],
12  "paths": {
13    "/acts/apify~puppeteer-scraper/run-sync-get-dataset-items": {
14      "post": {
15        "operationId": "run-sync-get-dataset-items-apify-puppeteer-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/apify~puppeteer-scraper/runs": {
50      "post": {
51        "operationId": "runs-sync-apify-puppeteer-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/apify~puppeteer-scraper/run-sync": {
93      "post": {
94        "operationId": "run-sync-apify-puppeteer-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          "startUrls",
135          "pageFunction"
136        ],
137        "properties": {
138          "startUrls": {
139            "title": "Start URLs",
140            "type": "array",
141            "description": "URLs to start with",
142            "items": {
143              "type": "object",
144              "required": [
145                "url"
146              ],
147              "properties": {
148                "url": {
149                  "type": "string",
150                  "title": "URL of a web page",
151                  "format": "uri"
152                }
153              }
154            }
155          },
156          "useRequestQueue": {
157            "title": "Use request queue",
158            "type": "boolean",
159            "description": "Request queue enables recursive crawling and the use of Pseudo-URLs and Link selector.",
160            "default": true
161          },
162          "pseudoUrls": {
163            "title": "Pseudo-URLs",
164            "type": "array",
165            "description": "Pseudo-URLs to match links in the page that you want to enqueue. Combine with Link selector to tell the crawler where to find links.",
166            "default": [],
167            "items": {
168              "type": "object",
169              "required": [
170                "purl"
171              ],
172              "properties": {
173                "purl": {
174                  "type": "string",
175                  "title": "Pseudo-URL of a web page"
176                }
177              }
178            }
179          },
180          "linkSelector": {
181            "title": "Link selector",
182            "type": "string",
183            "description": "CSS selector matching elements with 'href' attributes that should be enqueued. To enqueue urls from '<div class=\"my-class\" href=...>' tags, you would enter 'div.my-class'."
184          },
185          "pageFunction": {
186            "title": "Page function",
187            "type": "string",
188            "description": "Function executed for each request"
189          },
190          "proxyConfiguration": {
191            "title": "Proxy configuration",
192            "type": "object",
193            "description": "Choose to use no proxy, Apify Proxy, or provide custom proxy URLs.",
194            "default": {}
195          },
196          "debugLog": {
197            "title": "Debug log",
198            "type": "boolean",
199            "description": "Debug messages will be included in the log. Use <code>context.log.debug('message')</code> to log your own debug messages.",
200            "default": false
201          },
202          "browserLog": {
203            "title": "Browser log",
204            "type": "boolean",
205            "description": "Console messages from the Browser will be included in the log. This may result in the log being flooded by error messages, warnings and other messages of little value, especially with high concurrency.",
206            "default": false
207          },
208          "downloadMedia": {
209            "title": "Download media",
210            "type": "boolean",
211            "description": "Crawler will skip downloading media such as images, fonts, videos and sounds. This helps to speed up the crawl, but may break certain websites.",
212            "default": false
213          },
214          "downloadCss": {
215            "title": "Download CSS",
216            "type": "boolean",
217            "description": "Crawler will skip downloading CSS stylesheets. This helps to speed up the crawl, but may break certain websites.",
218            "default": false
219          },
220          "ignoreSslErrors": {
221            "title": "Ignore SSL errors",
222            "type": "boolean",
223            "description": "Crawler will ignore SSL certificate errors.",
224            "default": false
225          },
226          "maxRequestRetries": {
227            "title": "Max request retries",
228            "minimum": 0,
229            "type": "integer",
230            "description": "Maximum number of times the request for the page will be retried in case of an error. Setting it to 0 means that the request will be attempted once and will not be retried if it fails.",
231            "default": 3
232          },
233          "maxPagesPerCrawl": {
234            "title": "Max pages per crawl",
235            "minimum": 0,
236            "type": "integer",
237            "description": "Maximum number of pages that the crawler will open. 0 means unlimited.",
238            "default": 0
239          },
240          "maxResultsPerCrawl": {
241            "title": "Max result records",
242            "minimum": 0,
243            "type": "integer",
244            "description": "Maximum number of results that will be saved to dataset. The crawler will terminate afterwards. 0 means unlimited.",
245            "default": 0
246          },
247          "maxCrawlingDepth": {
248            "title": "Max crawling depth",
249            "minimum": 0,
250            "type": "integer",
251            "description": "Defines how many links away from the StartURLs will the crawler descend. 0 means unlimited.",
252            "default": 0
253          },
254          "maxConcurrency": {
255            "title": "Max concurrency",
256            "minimum": 1,
257            "type": "integer",
258            "description": "Defines how many pages can be processed by the scraper in parallel. The scraper automatically increases and decreases concurrency based on available system resources. Use this option to set a hard limit.",
259            "default": 50
260          },
261          "pageLoadTimeoutSecs": {
262            "title": "Page load timeout",
263            "minimum": 1,
264            "maximum": 360,
265            "type": "integer",
266            "description": "Maximum time the crawler will allow a web page to load in seconds.",
267            "default": 60
268          },
269          "pageFunctionTimeoutSecs": {
270            "title": "Page function timeout",
271            "minimum": 1,
272            "maximum": 360,
273            "type": "integer",
274            "description": "Maximum time the crawler will wait for the page function to execute in seconds.",
275            "default": 60
276          },
277          "customData": {
278            "title": "Custom data",
279            "type": "object",
280            "description": "This object will be available on pageFunction's context as customData.",
281            "default": {}
282          },
283          "initialCookies": {
284            "title": "Initial cookies",
285            "type": "array",
286            "description": "The provided cookies will be pre-set to all pages the scraper opens.",
287            "default": []
288          },
289          "preGotoFunction": {
290            "title": "Pre goto function",
291            "type": "string",
292            "description": "This function is executed before navigation to a given URL. It can be useful to do pre-processing, changes to the page that allow bypassing anti-scraping protections or just setting cookies."
293          }
294        }
295      },
296      "runsResponseSchema": {
297        "type": "object",
298        "properties": {
299          "data": {
300            "type": "object",
301            "properties": {
302              "id": {
303                "type": "string"
304              },
305              "actId": {
306                "type": "string"
307              },
308              "userId": {
309                "type": "string"
310              },
311              "startedAt": {
312                "type": "string",
313                "format": "date-time",
314                "example": "2025-01-08T00:00:00.000Z"
315              },
316              "finishedAt": {
317                "type": "string",
318                "format": "date-time",
319                "example": "2025-01-08T00:00:00.000Z"
320              },
321              "status": {
322                "type": "string",
323                "example": "READY"
324              },
325              "meta": {
326                "type": "object",
327                "properties": {
328                  "origin": {
329                    "type": "string",
330                    "example": "API"
331                  },
332                  "userAgent": {
333                    "type": "string"
334                  }
335                }
336              },
337              "stats": {
338                "type": "object",
339                "properties": {
340                  "inputBodyLen": {
341                    "type": "integer",
342                    "example": 2000
343                  },
344                  "rebootCount": {
345                    "type": "integer",
346                    "example": 0
347                  },
348                  "restartCount": {
349                    "type": "integer",
350                    "example": 0
351                  },
352                  "resurrectCount": {
353                    "type": "integer",
354                    "example": 0
355                  },
356                  "computeUnits": {
357                    "type": "integer",
358                    "example": 0
359                  }
360                }
361              },
362              "options": {
363                "type": "object",
364                "properties": {
365                  "build": {
366                    "type": "string",
367                    "example": "latest"
368                  },
369                  "timeoutSecs": {
370                    "type": "integer",
371                    "example": 300
372                  },
373                  "memoryMbytes": {
374                    "type": "integer",
375                    "example": 1024
376                  },
377                  "diskMbytes": {
378                    "type": "integer",
379                    "example": 2048
380                  }
381                }
382              },
383              "buildId": {
384                "type": "string"
385              },
386              "defaultKeyValueStoreId": {
387                "type": "string"
388              },
389              "defaultDatasetId": {
390                "type": "string"
391              },
392              "defaultRequestQueueId": {
393                "type": "string"
394              },
395              "buildNumber": {
396                "type": "string",
397                "example": "1.0.0"
398              },
399              "containerUrl": {
400                "type": "string"
401              },
402              "usage": {
403                "type": "object",
404                "properties": {
405                  "ACTOR_COMPUTE_UNITS": {
406                    "type": "integer",
407                    "example": 0
408                  },
409                  "DATASET_READS": {
410                    "type": "integer",
411                    "example": 0
412                  },
413                  "DATASET_WRITES": {
414                    "type": "integer",
415                    "example": 0
416                  },
417                  "KEY_VALUE_STORE_READS": {
418                    "type": "integer",
419                    "example": 0
420                  },
421                  "KEY_VALUE_STORE_WRITES": {
422                    "type": "integer",
423                    "example": 1
424                  },
425                  "KEY_VALUE_STORE_LISTS": {
426                    "type": "integer",
427                    "example": 0
428                  },
429                  "REQUEST_QUEUE_READS": {
430                    "type": "integer",
431                    "example": 0
432                  },
433                  "REQUEST_QUEUE_WRITES": {
434                    "type": "integer",
435                    "example": 0
436                  },
437                  "DATA_TRANSFER_INTERNAL_GBYTES": {
438                    "type": "integer",
439                    "example": 0
440                  },
441                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
442                    "type": "integer",
443                    "example": 0
444                  },
445                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
446                    "type": "integer",
447                    "example": 0
448                  },
449                  "PROXY_SERPS": {
450                    "type": "integer",
451                    "example": 0
452                  }
453                }
454              },
455              "usageTotalUsd": {
456                "type": "number",
457                "example": 0.00005
458              },
459              "usageUsd": {
460                "type": "object",
461                "properties": {
462                  "ACTOR_COMPUTE_UNITS": {
463                    "type": "integer",
464                    "example": 0
465                  },
466                  "DATASET_READS": {
467                    "type": "integer",
468                    "example": 0
469                  },
470                  "DATASET_WRITES": {
471                    "type": "integer",
472                    "example": 0
473                  },
474                  "KEY_VALUE_STORE_READS": {
475                    "type": "integer",
476                    "example": 0
477                  },
478                  "KEY_VALUE_STORE_WRITES": {
479                    "type": "number",
480                    "example": 0.00005
481                  },
482                  "KEY_VALUE_STORE_LISTS": {
483                    "type": "integer",
484                    "example": 0
485                  },
486                  "REQUEST_QUEUE_READS": {
487                    "type": "integer",
488                    "example": 0
489                  },
490                  "REQUEST_QUEUE_WRITES": {
491                    "type": "integer",
492                    "example": 0
493                  },
494                  "DATA_TRANSFER_INTERNAL_GBYTES": {
495                    "type": "integer",
496                    "example": 0
497                  },
498                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
499                    "type": "integer",
500                    "example": 0
501                  },
502                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
503                    "type": "integer",
504                    "example": 0
505                  },
506                  "PROXY_SERPS": {
507                    "type": "integer",
508                    "example": 0
509                  }
510                }
511              }
512            }
513          }
514        }
515      }
516    }
517  }
518}

Puppeteer 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 Puppeteer 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: