In this post, I’d like to demonstrate how to leverage the Dexi.io (CloudScrape) API along with its PHP Client library (also avail in Ruby and C#).

There are basically two parameters to initiate API Client: API Key and Account ID. Run ID or Execution ID are to access corresponding parameters.

API Key

To get access to your CloudScrape account through an API – you firstly need to create an API key(s) in your account settings:cloudscrape apikey

Account ID

Then you move to the API page (click API tab at the left pane) to view and retrieve you Account ID:

cloudscrape account key

Run ID

To fetch the project’s run ID, just open a corresponding run (Projects left-pane tab and unfold scraper in the view). The picture below shows where to get run ID:

cloudscrape runId

Alternatively to a run ID  you might fetch execution ID – the result of any executed run.

API libraries

To have Access to the API libraries you again travel to API page and click Client libraries.

cloudscrape libraries

To directly download/fork PHP  CloudScrape Client visit here. Download CloudScrape.php and put it onto your server. Then create a PHP file in the same directory where CloudScrape.php is put.

Code

Now let’s put the following PHP code into that file in order to leverage CloudScrape Client functionality. Ready to retrieve some data:

Sum up

The Dexi.io is the modern web scraping service providing not just point-and-click UI for scrape agents creation but also the REST API in PHP for managing robots, executions and retrieving results. The latter is greatly supported with PHP, Ruby and C# client libraries.