
Legacy PhantomJS Crawler
No credit card required

Legacy PhantomJS Crawler
No credit card required
Replacement for the legacy Apify Crawler product with a backward-compatible interface. The actor uses PhantomJS headless browser to recursively crawl websites and extract data from them using a piece of front-end JavaScript code.
You can access the Legacy PhantomJS Crawler 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": "Mqc7kLzYAQiXg4012"
6 },
7 "servers": [
8 {
9 "url": "https://api.apify.com/v2"
10 }
11 ],
12 "paths": {
13 "/acts/apify~legacy-phantomjs-crawler/run-sync-get-dataset-items": {
14 "post": {
15 "operationId": "run-sync-get-dataset-items-apify-legacy-phantomjs-crawler",
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~legacy-phantomjs-crawler/runs": {
50 "post": {
51 "operationId": "runs-sync-apify-legacy-phantomjs-crawler",
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~legacy-phantomjs-crawler/run-sync": {
93 "post": {
94 "operationId": "run-sync-apify-legacy-phantomjs-crawler",
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 ],
136 "properties": {
137 "startUrls": {
138 "title": "Start URLs",
139 "minItems": 1,
140 "type": "array",
141 "description": "List of URLs that will be loaded by the crawler on start. For a POST request, append [POST] to the URL, e.g. <code>http://www.example.com/[POST]</code>",
142 "items": {
143 "type": "object",
144 "required": [
145 "key",
146 "value"
147 ],
148 "properties": {
149 "key": {
150 "type": "string",
151 "title": "Key"
152 },
153 "value": {
154 "type": "string",
155 "title": "Value"
156 }
157 }
158 }
159 },
160 "crawlPurls": {
161 "title": "Pseudo-URLs",
162 "type": "array",
163 "description": "Specifies URLs of pages to crawl. Put regular expressions in [ ] brackets, e.g. <code>http://www.example.com/[.*]</code>",
164 "items": {
165 "type": "object",
166 "required": [
167 "key",
168 "value"
169 ],
170 "properties": {
171 "key": {
172 "type": "string",
173 "title": "Key"
174 },
175 "value": {
176 "type": "string",
177 "title": "Value"
178 }
179 }
180 }
181 },
182 "clickableElementsSelector": {
183 "title": "Clickable elements",
184 "type": "string",
185 "description": "CSS selector used to find links to other web pages. Leave empty to ignore all links.<br><br>For example: <code>a[href]</code>"
186 },
187 "pageFunction": {
188 "title": "Page function",
189 "type": "string",
190 "description": "JavaScript function that is executed on every crawled page, use it to extract data. Note that only ES5.1 syntax is supported."
191 },
192 "interceptRequest": {
193 "title": "Intercept request function",
194 "type": "string",
195 "description": "JavaScript function called whenever the crawler finds a link or form leading to a new web page. Note that only ES5.1 syntax is supported"
196 },
197 "considerUrlFragment": {
198 "title": "URL #fragments identify unique pages",
199 "type": "boolean",
200 "description": "Indicates that the URL fragment identifier (i.e. <code>http://example.com/page#<b>this-guy-here</b></code>) should be considered when matching a URL against a Pseudo-URL or when checking whether a page has already been visited. Typically, URL fragments are used as internal page anchors and therefore they should be ignored because they don't represent separate pages. However, many AJAX-based website nowadays use URL fragment to represent page parameters; in such cases, this option should be enabled.",
201 "default": false
202 },
203 "loadImages": {
204 "title": "Download HTML images",
205 "type": "boolean",
206 "description": "Indicates whether the crawler should load HTML images, both those included using the <code><img></code> tag as well as those included in CSS styles. Disable this feature after you have fine-tuned your crawler in order to increase crawling performance and reduce your bandwidth costs.",
207 "default": true
208 },
209 "loadCss": {
210 "title": "Download CSS files",
211 "type": "boolean",
212 "description": "Indicates whether the crawler should load CSS stylesheet files. Disable this feature after you have fine-tuned your crawler in order to increase crawling performance and reduce your bandwidth costs.",
213 "default": true
214 },
215 "injectJQuery": {
216 "title": "Inject jQuery",
217 "type": "boolean",
218 "description": "Indicates that the <a href='http://jquery.com' target='_blank' rel='noopener'>jQuery</a> library should be injected into each page before <b>Page function</b> is invoked. Note that the jQuery object will not be registered into global namespace in order to avoid conflicts with libraries used by the web page. It can only be accessed through <code>context.jQuery</code>.",
219 "default": true
220 },
221 "injectUnderscoreJs": {
222 "title": "Inject Underscore.js",
223 "type": "boolean",
224 "description": "Indicates that the <a href='http://underscorejs.org' target='_blank' rel='noopener'>Underscore.js</a> library should be injected into each page before <b>Page function</b> is invoked. Note that the Underscore object will not be registered into global namespace in order to avoid conflicts with libraries used by the web page. It can only be accessed through <code>context.underscoreJs</code>.",
225 "default": false
226 },
227 "ignoreRobotsTxt": {
228 "title": "Ignore robots exclusion standards",
229 "type": "boolean",
230 "description": "Indicates that the crawler should ignore <code>robots.txt</code>, <code><meta name='robots'></code> tags and <code>X-Robots-Tag</code> HTTP headers. Use this feature at your own risk!",
231 "default": false
232 },
233 "skipLoadingFrames": {
234 "title": "Don't load frames and IFRAMEs",
235 "type": "boolean",
236 "description": "Indicates that child frames included using FRAME or IFRAME tags will not be loaded by the crawler. This might improve crawling performance. As a side-effect, JavaScript redirects issued by the page before it was completely loaded will not be performed, which might be useful in certain situations.",
237 "default": false
238 },
239 "verboseLog": {
240 "title": "Verbose log",
241 "type": "boolean",
242 "description": "If enabled, the log will also contain DEBUG messages. Note that this setting will dramatically slow down the crawler as well as your web browser and increase the log size.",
243 "default": false
244 },
245 "disableWebSecurity": {
246 "title": "Disable web security",
247 "type": "boolean",
248 "description": "If checked, the virtual browser will allow cross-domain XHRs and untrusted SSL certificates, so that your crawler can access content from any domain. Only activate this feature if you know what you're doing!",
249 "default": false
250 },
251 "rotateUserAgents": {
252 "title": "Rotate User-Agent headers",
253 "type": "boolean",
254 "description": "If checked, the crawler automatically rotates the <code>User-Agent</code> HTTP header for each new IP address, from a pre-defined list. This settings overwrites <code>User-Agent</code> set in <b>Custom HTTP headers</b>.",
255 "default": false
256 },
257 "maxCrawledPages": {
258 "title": "Max pages per crawl",
259 "minimum": 1,
260 "maximum": 999999999,
261 "type": "integer",
262 "description": "Maximum number of pages that the crawler will open. The crawl will stop when this limit is reached. Always set this value in order to prevent infinite loops in misconfigured crawlers. Note that in cases of parallel crawling, the actual number of pages visited might be slightly higher than this value."
263 },
264 "maxOutputPages": {
265 "title": "Max result records",
266 "minimum": 1,
267 "maximum": 999999999,
268 "type": "integer",
269 "description": "Maximum number of pages the crawler can output to JSON. The crawl will stop when this limit is reached. This value is useful when you only need a limited number of results."
270 },
271 "maxCrawlDepth": {
272 "title": "Max crawling depth",
273 "minimum": 1,
274 "maximum": 999999999,
275 "type": "integer",
276 "description": "Defines how many links away from the start URLs the crawler will descend. This value is a safeguard against infinite crawling depths on misconfigured crawlers. Note that pages added using <code>enqueuePage()</code> in <b>Page function</b> are not subject to the maximum depth constraint."
277 },
278 "timeout": {
279 "title": "Execution timeout",
280 "minimum": 1,
281 "maximum": 1814400,
282 "type": "integer",
283 "description": "This field has been deprecated and its value is ignored. To set the execution timeout, use the actor run timeout option instead.",
284 "default": 604800
285 },
286 "resourceTimeout": {
287 "title": "Resource timeout",
288 "minimum": 100,
289 "maximum": 1000000,
290 "type": "integer",
291 "description": "Timeout for network resources loaded by the crawler, in milliseconds.",
292 "default": 30000
293 },
294 "pageLoadTimeout": {
295 "title": "Page load timeout",
296 "minimum": 100,
297 "maximum": 1000000,
298 "type": "integer",
299 "description": "Timeout for web page load, in milliseconds. If the web page does not load in this time frame, it is considered to have failed and will be retried, similarly as with other page load errors.",
300 "default": 60000
301 },
302 "pageFunctionTimeout": {
303 "title": "Page function timeout",
304 "minimum": 0,
305 "maximum": 3600000,
306 "type": "integer",
307 "description": "Timeout for the asynchronous part of the <b>Page function</b>, in milliseconds. Note that this value is only applied if your page function runs code in the background, i.e. when it invokes <code>context.willFinishLater()</code>. The page function itself always runs to completion regardless of the timeout.",
308 "default": 600000
309 },
310 "maxInfiniteScrollHeight": {
311 "title": "Infinite scroll height",
312 "minimum": 0,
313 "maximum": 1000000,
314 "type": "integer",
315 "description": "Defines the maximum client height in pixels to which the browser window is scrolled in order to fetch dynamic AJAX-based content from the web server. By default, the crawler doesn't scroll and uses a fixed browser window size. Note that you might need to enable <b>Download HTML images</b> to make infinite scroll work, because otherwise the crawler wouldn't know that some resources are still being loaded and will stop infinite scrolling prematurely."
316 },
317 "randomWaitBetweenRequests": {
318 "title": "Delay between requests",
319 "minimum": 1000,
320 "maximum": 1000000,
321 "type": "integer",
322 "description": "This option forces the crawler to ensure a minimum time interval between opening two web pages, in order to prevent it from overloading the target server. The actual minimum time is a random value drawn from a Gaussian distribution with a mean specified by your setting (in milliseconds) and a standard deviation corresponding to 25% of the mean. The minimum value is 1000 milliseconds, the crawler never issues requests in shorter intervals than 1000 milliseconds.",
323 "default": 1000
324 },
325 "maxCrawledPagesPerSlave": {
326 "title": "Max pages per IP address",
327 "minimum": 1,
328 "maximum": 100,
329 "type": "integer",
330 "description": "Maximum number of pages that a single crawling process will open before it is restarted with a new proxy server setting. This option can help avoid the blocking of the crawler by the target server and also ensures that the crawling processes don't grow too large, as they are killed periodically.",
331 "default": 50
332 },
333 "maxParallelRequests": {
334 "title": "Max parallel processes",
335 "minimum": 1,
336 "maximum": 100,
337 "type": "integer",
338 "description": "The maximum number of parallel processes that will perform the crawl. The actual number might be lower if the actor runs without enough memory. Note that each parallel process uses a different proxy (if enabled).",
339 "default": 50
340 },
341 "maxPageRetryCount": {
342 "title": "Max page retries",
343 "minimum": 0,
344 "maximum": 10,
345 "type": "integer",
346 "description": "The maximum number of times the crawler will retry to open a web page on load error. Note that on page function errors, the pages are not retried.",
347 "default": 3
348 },
349 "customHttpHeaders": {
350 "title": "Custom HTTP headers",
351 "type": "array",
352 "description": "Custom HTTP headers set by the crawler to all requests. It is an array of objects, where each object has the <code>key</code> and <code>value</code> properties.",
353 "items": {
354 "type": "object",
355 "required": [
356 "key",
357 "value"
358 ],
359 "properties": {
360 "key": {
361 "type": "string",
362 "title": "Key"
363 },
364 "value": {
365 "type": "string",
366 "title": "Value"
367 }
368 }
369 }
370 },
371 "proxyConfiguration": {
372 "title": "Proxy configuration",
373 "type": "object",
374 "description": "Specifies the type of proxy servers that will be used by the crawler in order to hide its origin."
375 },
376 "proxyType": {
377 "title": "Proxy type (legacy)",
378 "type": "string",
379 "description": "Specifies the type of proxy servers that will be used by the crawler.<br><br>This is a legacy option only kept for backwards compatibility, use <b>proxyConfiguration</b> instead!"
380 },
381 "customProxies": {
382 "title": "Custom proxies (legacy)",
383 "type": "string",
384 "description": "Specifies Apify Proxy groups to be used when <b>proxyType</b> is <code>CUSTOM</code>. Each proxy should be specified in the <code>scheme://user:password@host:port</code> format, multiple proxies should be separated by a space or new line. <br><br>This is a legacy option only kept for backwards compatibility - use <b>proxyConfiguration</b> instead!"
385 },
386 "customData": {
387 "title": "Custom data",
388 "description": "A custom JSON object that is passed to <b>Page function</b> and intercept request function as <code>context.customData</code>. This setting is mainly useful if you're invoking the crawler using the API, so that you can pass some arbitrary parameters to your code."
389 },
390 "finishWebhookUrl": {
391 "title": "Finish webhook URL",
392 "pattern": "^(?:(?:[hH][tT][tT][pP][sS]?):\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?!10(?:\\.\\d{1,3}){3})(?!127(?:\\.\\d{1,3}){3})(?!169\\.254(?:\\.\\d{1,3}){2})(?!192\\.168(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-zA-Z\\u00a1-\\uffff0-9]+-?)*[a-zA-Z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-zA-Z\\u00a1-\\uffff0-9]+-?)*[a-zA-Z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-zA-Z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:\\/[^\\s]*)?$",
393 "maxLength": 1000,
394 "type": "string",
395 "description": "An HTTP endpoint that receives a POST request right after the run of this actor finishes. The POST payload is a JSON object with the following properties: <code>actorId</code>, <code>runId</code>, <code>taskId</code>, <code>datasetId</code> and <code>data</code><br><br>For more information about finish webhooks, please see the actor README."
396 },
397 "finishWebhookData": {
398 "title": "Finish webhook data",
399 "maxLength": 10000,
400 "type": "string",
401 "description": "Custom string that is sent in the POST payload to <b>Finish webhook URL</b>, as the <code>data</code> property. <br><br>For more information about finish webhooks, please see the actor README."
402 },
403 "cookiesPersistence": {
404 "title": "Cookies persistence",
405 "enum": [
406 "PER_PROCESS",
407 "PER_CRAWLER_RUN",
408 "OVER_CRAWLER_RUNS"
409 ],
410 "type": "string",
411 "description": "Indicates how cookies collected by the crawler are persisted. This is useful if you need to maintain a login.<br><br>For more information about cookies, please see the actor README.",
412 "default": "PER_PROCESS"
413 },
414 "cookies": {
415 "title": "Initial cookies",
416 "type": "array",
417 "description": "JSON array with cookies that the crawler starts with. This is useful for reusing a login from an external web browser. Note that if the <b>Cookies persistence</b> setting is <b>Over all crawler runs</b>, this field in the actor task configuration will be overwritten with new cookies from the crawler whenever it successfully finishes.<br><br>For more information about cookies, please see the actor README."
418 }
419 }
420 },
421 "runsResponseSchema": {
422 "type": "object",
423 "properties": {
424 "data": {
425 "type": "object",
426 "properties": {
427 "id": {
428 "type": "string"
429 },
430 "actId": {
431 "type": "string"
432 },
433 "userId": {
434 "type": "string"
435 },
436 "startedAt": {
437 "type": "string",
438 "format": "date-time",
439 "example": "2025-01-08T00:00:00.000Z"
440 },
441 "finishedAt": {
442 "type": "string",
443 "format": "date-time",
444 "example": "2025-01-08T00:00:00.000Z"
445 },
446 "status": {
447 "type": "string",
448 "example": "READY"
449 },
450 "meta": {
451 "type": "object",
452 "properties": {
453 "origin": {
454 "type": "string",
455 "example": "API"
456 },
457 "userAgent": {
458 "type": "string"
459 }
460 }
461 },
462 "stats": {
463 "type": "object",
464 "properties": {
465 "inputBodyLen": {
466 "type": "integer",
467 "example": 2000
468 },
469 "rebootCount": {
470 "type": "integer",
471 "example": 0
472 },
473 "restartCount": {
474 "type": "integer",
475 "example": 0
476 },
477 "resurrectCount": {
478 "type": "integer",
479 "example": 0
480 },
481 "computeUnits": {
482 "type": "integer",
483 "example": 0
484 }
485 }
486 },
487 "options": {
488 "type": "object",
489 "properties": {
490 "build": {
491 "type": "string",
492 "example": "latest"
493 },
494 "timeoutSecs": {
495 "type": "integer",
496 "example": 300
497 },
498 "memoryMbytes": {
499 "type": "integer",
500 "example": 1024
501 },
502 "diskMbytes": {
503 "type": "integer",
504 "example": 2048
505 }
506 }
507 },
508 "buildId": {
509 "type": "string"
510 },
511 "defaultKeyValueStoreId": {
512 "type": "string"
513 },
514 "defaultDatasetId": {
515 "type": "string"
516 },
517 "defaultRequestQueueId": {
518 "type": "string"
519 },
520 "buildNumber": {
521 "type": "string",
522 "example": "1.0.0"
523 },
524 "containerUrl": {
525 "type": "string"
526 },
527 "usage": {
528 "type": "object",
529 "properties": {
530 "ACTOR_COMPUTE_UNITS": {
531 "type": "integer",
532 "example": 0
533 },
534 "DATASET_READS": {
535 "type": "integer",
536 "example": 0
537 },
538 "DATASET_WRITES": {
539 "type": "integer",
540 "example": 0
541 },
542 "KEY_VALUE_STORE_READS": {
543 "type": "integer",
544 "example": 0
545 },
546 "KEY_VALUE_STORE_WRITES": {
547 "type": "integer",
548 "example": 1
549 },
550 "KEY_VALUE_STORE_LISTS": {
551 "type": "integer",
552 "example": 0
553 },
554 "REQUEST_QUEUE_READS": {
555 "type": "integer",
556 "example": 0
557 },
558 "REQUEST_QUEUE_WRITES": {
559 "type": "integer",
560 "example": 0
561 },
562 "DATA_TRANSFER_INTERNAL_GBYTES": {
563 "type": "integer",
564 "example": 0
565 },
566 "DATA_TRANSFER_EXTERNAL_GBYTES": {
567 "type": "integer",
568 "example": 0
569 },
570 "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
571 "type": "integer",
572 "example": 0
573 },
574 "PROXY_SERPS": {
575 "type": "integer",
576 "example": 0
577 }
578 }
579 },
580 "usageTotalUsd": {
581 "type": "number",
582 "example": 0.00005
583 },
584 "usageUsd": {
585 "type": "object",
586 "properties": {
587 "ACTOR_COMPUTE_UNITS": {
588 "type": "integer",
589 "example": 0
590 },
591 "DATASET_READS": {
592 "type": "integer",
593 "example": 0
594 },
595 "DATASET_WRITES": {
596 "type": "integer",
597 "example": 0
598 },
599 "KEY_VALUE_STORE_READS": {
600 "type": "integer",
601 "example": 0
602 },
603 "KEY_VALUE_STORE_WRITES": {
604 "type": "number",
605 "example": 0.00005
606 },
607 "KEY_VALUE_STORE_LISTS": {
608 "type": "integer",
609 "example": 0
610 },
611 "REQUEST_QUEUE_READS": {
612 "type": "integer",
613 "example": 0
614 },
615 "REQUEST_QUEUE_WRITES": {
616 "type": "integer",
617 "example": 0
618 },
619 "DATA_TRANSFER_INTERNAL_GBYTES": {
620 "type": "integer",
621 "example": 0
622 },
623 "DATA_TRANSFER_EXTERNAL_GBYTES": {
624 "type": "integer",
625 "example": 0
626 },
627 "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
628 "type": "integer",
629 "example": 0
630 },
631 "PROXY_SERPS": {
632 "type": "integer",
633 "example": 0
634 }
635 }
636 }
637 }
638 }
639 }
640 }
641 }
642 }
643}
Legacy PhantomJS Crawler - Crawl websites, extract data 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 Legacy PhantomJS Crawler 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
94 monthly users
-
22 bookmarks
>99% runs succeeded
Created in Mar 2019
Modified 8 months ago