PHPackages                             proxycrawl/proxycrawl - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. proxycrawl/proxycrawl

Abandoned → [crawlbase/crawlbase](/?search=crawlbase%2Fcrawlbase)ArchivedLibrary[API Development](/categories/api)

proxycrawl/proxycrawl
=====================

A lightweight, dependency free PHP class that acts as wrapper for ProxyCrawl API

3.0.0(4y ago)2198.0k↓19.1%5[1 issues](https://github.com/crawlbase-source/proxycrawl-php/issues)Apache-2.0PHPPHP &gt;=5.4.0

Since May 27Pushed 2y ago3 watchersCompare

[ Source](https://github.com/crawlbase-source/proxycrawl-php)[ Packagist](https://packagist.org/packages/proxycrawl/proxycrawl)[ Docs](https://github.com/proxycrawl/proxycrawl-php)[ RSS](/packages/proxycrawl-proxycrawl/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (14)Used By (0)

DEPRECATION NOTICE
==================

[](#deprecation-notice)

> ⚠️ **IMPORTANT:** This package is no longer maintained or supported. For the latest updates, please use our new package at [crawlbase-php](https://github.com/crawlbase-source/crawlbase-php).

---

ProxyCrawl API PHP class
========================

[](#proxycrawl-api-php-class)

A lightweight, dependency free PHP class that acts as wrapper for ProxyCrawl API.

Installing
----------

[](#installing)

Choose a way of installing:

- Use [Packagist](https://packagist.org/packages/proxycrawl/proxycrawl) PHP package manager.
- Download the project from Github and save it into your project so you can require it `require_once('proxycrawl-php/src/[class].php')`

Crawling API
------------

[](#crawling-api)

First initialize the CrawlingAPI class. You can [get your free token here](https://proxycrawl.com/signup?signup=github).

```
$api = new ProxyCrawl\CrawlingAPI(['token' => 'YOUR_PROXYCRAWL_TOKEN']);
```

### GET requests

[](#get-requests)

Pass the url that you want to scrape plus any options from the ones available in the [API documentation](https://proxycrawl.com/docs/crawling-api/).

```
$api->get(string $url, array $options = []);
```

Example:

```
$response = $api->get('https://www.facebook.com/britneyspears');
if ($response->statusCode === 200) {
  echo $response->body;
}
```

You can pass any options from ProxyCrawl API.

Example:

```
$response = $api->get('https://www.reddit.com/r/pics/comments/5bx4bx/thanks_obama/', [
  'user_agent' => 'Mozilla/5.0 (Windows NT 6.2; rv:20.0) Gecko/20121202 Firefox/30.0',
  'format' => 'json'
]);
if ($response->statusCode === 200) {
  echo $response->body;
}
```

Optionally pass [store](https://proxycrawl.com/docs/crawling-api/parameters/#store) parameter to `true` to store a copy of the API response in the [ProxyCrawl Cloud Storage](https://proxycrawl.com/dashboard/storage).

Example:

```
$response = $api->get('https://www.reddit.com/r/pics/comments/5bx4bx/thanks_obama/', [
  'store' => true
]);

if ($response->statusCode === 200) {
  echo 'storage url: ' . $response->headers->storage_url . PHP_EOL;
}
```

### POST requests

[](#post-requests)

Pass the url that you want to scrape, the data that you want to send which can be either a json or a string, plus any options from the ones available in the [API documentation](https://proxycrawl.com/docs/crawling-api/).

```
$api->post(string $url, array or string $data, array options = []);
```

Example:

```
$response = $api->post('https://producthunt.com/search', ['text' => 'example search']);
if ($response->statusCode === 200) {
  echo $response->body;
}
```

You can send the data as `application/json` instead of `x-www-form-urlencoded` by setting option `post_content_type` as json.

```
$response = $api->post('https://httpbin.org/post', json_encode(['some_json' => 'with some value']), ['post_content_type' => 'json']);
if ($response->statusCode === 200) {
  echo $response->body;
}
```

### PUT requests

[](#put-requests)

Pass the url that you want to scrape, the data that you want to send which can be either a json or a string, plus any options from the ones available in the [API documentation](https://proxycrawl.com/docs/crawling-api/).

```
$api->put(string $url, array or string $data, array options = []);
```

Example:

```
$response = $api->put('https://producthunt.com/search', ['text' => 'example search']);
if ($response->statusCode === 200) {
  echo $response->body;
}
```

### Javascript requests

[](#javascript-requests)

If you need to scrape any website built with Javascript like React, Angular, Vue, etc. You just need to pass your javascript token and use the same calls. Note that only `->get` is available for javascript and not `->post`.

```
$api = new ProxyCrawl\CrawlingAPI(['token' => 'YOUR_JAVASCRIPT_TOKEN']);
```

```
$response = $api->get('https://www.nfl.com');
if ($response->statusCode === 200) {
  echo $response->body;
}
```

Same way you can pass javascript additional options.

```
$response = $api->get('https://www.freelancer.com', ['page_wait' => 5000]);
if ($response->statusCode === 200) {
  echo $response->body;
}
```

Original status
---------------

[](#original-status)

You can always get the original status and proxycrawl status from the response. Read the [ProxyCrawl documentation](https://proxycrawl.com/docs/crawling-api/) to learn more about those status.

```
$response = $api->get('https://craiglist.com');
echo $response->headers->original_status . PHP_EOL;
echo $response->headers->pc_status . PHP_EOL;
```

Scraper API
-----------

[](#scraper-api)

First initialize the ScraperAPI class. You can [get your free token here](https://proxycrawl.com/signup?signup=github). Please note that only some websites are supported, check the [API documentation](https://proxycrawl.com/docs/scraper-api/) for more information.

```
$api = new ProxyCrawl\ScraperAPI(['token' => 'YOUR_PROXYCRAWL_TOKEN']);
```

Pass the url that you want to scrape plus any options from the ones available in the [API documentation](https://proxycrawl.com/docs/scraper-api/).

Example:

```
$response = $api->get('https://www.amazon.com/DualSense-Wireless-Controller-PlayStation-5/dp/B08FC6C75Y/');
echo 'status code: ' . $response->statusCode . PHP_EOL;
if ($response->statusCode === 200) {
  var_dump($response->json); // Will print scraped Amazon details
}
```

Leads API
---------

[](#leads-api)

First initialize the LeadsAPI class. You can [get your free token here](https://proxycrawl.com/signup?signup=github).

```
$api = new ProxyCrawl\LeadsAPI(['token' => 'YOUR_PROXYCRAWL_TOKEN']);
```

Pass the domain where you want to search for leads.

Example:

```
$response = $api->getFromDomain('target.com');
if ($response->statusCode === 200) {
  foreach ($response->json->leads as $key => $lead) {
    echo $lead->email . PHP_EOL;
  }
}
```

Screenshots API usage
---------------------

[](#screenshots-api-usage)

Initialize with your Screenshots API token and call the `get` method.

```
$api = new ProxyCrawl\ScreenshotsAPI(['token' => 'YOUR_PROXYCRAWL_TOKEN']);
$response = $api->get('https://www.apple.com');
echo 'success: ' . $response->headers->success . PHP_EOL;
echo 'remaining requests: ' . $response->headers->remaining_requests . PHP_EOL;
file_put_contents('apple.jpg', $response->body);
```

or you can specify a callback that automatically saves the file to the temporary folder

```
$api = new ProxyCrawl\ScreenshotsAPI(['token' => 'YOUR_PROXYCRAWL_TOKEN']);
$response = $api->get('https://www.apple.com', [
  'callback' => function($filepath) {
    echo 'filepath: ' . $filepath . PHP_EOL;
  }
]);
echo 'success: ' . $response->headers->success . PHP_EOL;
echo 'remaining requests: ' . $response->headers->remaining_requests . PHP_EOL;
```

or specifying a file path via `saveToPath` option

```
$api = new ProxyCrawl\ScreenshotsAPI(['token' => 'YOUR_PROXYCRAWL_TOKEN']);
$response = $api->get('https://www.apple.com', [
  'saveToPath' => 'apple.jpg',
  'callback' => function($filepath) {
    echo 'filepath: ' . $filepath . PHP_EOL;
  }
]);
echo 'success: ' . $response->headers->success . PHP_EOL;
echo 'remaining requests: ' . $response->headers->remaining_requests . PHP_EOL;
```

Note that `$api.get(url, options)` method accepts an [options](https://proxycrawl.com/docs/screenshots-api/parameters)

Storage API usage
-----------------

[](#storage-api-usage)

Initialize the Storage API using your private token.

```
$api = new ProxyCrawl\StorageAPI(['token' => 'YOUR_PROXYCRAWL_TOKEN']);
```

Pass the [url](https://proxycrawl.com/docs/storage-api/parameters/#url) that you want to get from [Proxycrawl Storage](https://proxycrawl.com/dashboard/storage).

```
$response = $api->get('https://www.apple.com');

echo 'status code: ' . $response->statusCode . PHP_EOL;
if ($response->statusCode === 200) {
  echo 'body: ' . $response->body . PHP_EOL;
  echo 'original status: ' . $response->headers->original_status . PHP_EOL;
  echo 'proxycrawl status: ' . $response->headers->pc_status . PHP_EOL;
  echo 'rid: ' . $response->headers->rid . PHP_EOL;
  echo 'url: ' . $response->headers->url . PHP_EOL;
  echo 'stored date: ' . $response->headers->stored_at . PHP_EOL;
}
```

or you can use the [RID](https://proxycrawl.com/docs/storage-api/parameters/#rid)

```
$response = $api->get('RID_REPLACE');

echo 'status code: ' . $response->statusCode . PHP_EOL;
if ($response->statusCode === 200) {
  echo 'body: ' . $response->body . PHP_EOL;
  echo 'original status: ' . $response->headers->original_status . PHP_EOL;
  echo 'proxycrawl status: ' . $response->headers->pc_status . PHP_EOL;
  echo 'rid: ' . $response->headers->rid . PHP_EOL;
  echo 'url: ' . $response->headers->url . PHP_EOL;
  echo 'stored date: ' . $response->headers->stored_at . PHP_EOL;
}
```

Note: One of the two RID or URL must be sent. So both are optional but it's mandatory to send one of the two.

### [Delete](https://proxycrawl.com/docs/storage-api/delete/) request

[](#delete-request)

To delete a storage item from your storage area, use the correct RID

```
if ($api->delete('RID_REPLACE')) {
  echo 'delete success' . PHP_EOL;
  echo 'status code: ' . $api->response->statusCode . PHP_EOL;
} else {
  echo 'delete failed' . PHP_EOL;
  echo 'status code: ' . $api->response->statusCode . PHP_EOL;
}
```

### [Bulk](https://proxycrawl.com/docs/storage-api/bulk/) request

[](#bulk-request)

To do a bulk request with a list of RIDs, please send the list of rids as an array

```
$items = $api->bulk(['RID1', 'RID2', 'RID3', ...]);
foreach ($items as $item) {
  echo 'body: ' . $item->body . PHP_EOL;
  echo 'stored at: ' . $item->stored_at . PHP_EOL;
  echo 'original status: ' . $item->original_status . PHP_EOL;
  echo 'proxycrawl status: ' . $item->pc_status . PHP_EOL;
  echo 'rid: ' . $item->rid . PHP_EOL;
  echo 'url: ' . $item->url . PHP_EOL;
  echo PHP_EOL;
}
```

### [RIDs](https://proxycrawl.com/docs/storage-api/rids) request

[](#rids-request)

To request a bulk list of RIDs from your storage area

```
$rids = $api->rids();
foreach ($rids as $rid) {
  echo $rid . PHP_EOL;
}
```

You can also specify a limit as a parameter

```
$rids = $api->rids(10);
```

### [Total Count](https://proxycrawl.com/docs/storage-api/total_count)

[](#total-count)

To get the total number of documents in your storage area

```
$totalCount = $api->totalCount();
echo 'total count: ' . $totalCount . PHP_EOL;
```

If you have questions or need help using the library, please open an issue or [contact us](https://proxycrawl.com/contact).

---

Copyright 2023 ProxyCrawl

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community13

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~96 days

Recently: every ~163 days

Total

13

Last Release

1750d ago

Major Versions

1.4.1 → 2.0.02020-12-21

2.0.1 → 3.0.02021-08-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/b7f3346e0891ed476cb771b0fddf78fcc7dfe8268106a5ee8459d40510c57c24?d=identicon)[proxycrawl](/maintainers/proxycrawl)

---

Top Contributors

[![crawlbase](https://avatars.githubusercontent.com/u/39630115?v=4)](https://github.com/crawlbase "crawlbase (3 commits)")[![bobey](https://avatars.githubusercontent.com/u/807362?v=4)](https://github.com/bobey "bobey (1 commits)")

---

Tags

crawlercrawlingproxycrawlproxycrawl-apiscraperscrapersscrapingscraping-frameworkscraping-websitescrawlerleadsscrapercrawlingscrapingscraping apiscraper apicrawler apicrawling apileads apiproxycrawl

### Embed Badge

![Health badge](/badges/proxycrawl-proxycrawl/health.svg)

```
[![Health](https://phpackages.com/badges/proxycrawl-proxycrawl/health.svg)](https://phpackages.com/packages/proxycrawl-proxycrawl)
```

###  Alternatives

[crawlbase/crawlbase

A lightweight, dependency free PHP class that acts as wrapper for Crawlbase API

1650.5k](/packages/crawlbase-crawlbase)[crwlr/crawler

Web crawling and scraping library.

37214.8k2](/packages/crwlr-crawler)[duzun/hquery

An extremely fast web scraper that parses megabytes of HTML in a blink of an eye. No dependencies. PHP5+

363146.3k4](/packages/duzun-hquery)[laurentvw/scrapher

A web scraper for PHP to easily extract data from web pages

192.5k1](/packages/laurentvw-scrapher)[crwlr/robots-txt

Robots Exclusion Standard/Protocol Parser for Web Crawling/Scraping

1125.3k1](/packages/crwlr-robots-txt)[outscraper/outscraper

PHP bindings for the Outscraper API

1822.2k](/packages/outscraper-outscraper)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
