Developer guides
Use the official Packagist beta SDK from Laravel, Symfony, and PHP backend integrations. Built on curl with no runtime dependencies beyond standard extensions.
Verified HTTP pattern
GET /bing/search
Request
GET https://api.crawlora.net/api/v1/bing/search?q=best+CRM+software&country=us&count=10
x-api-key: $CRAWLORA_API_KEYBase URL
https://api.crawlora.net/api/v1
Auth header
x-api-key
Example endpoint
GET /bing/search
The PHP SDK is published to Packagist as crawlora/sdk and developed at https://github.com/Crawlora-org/crawlora-php-sdk. Install the current promoted beta release and keep API keys in server-side environments. Requires PHP 8.1+ with the curl and json extensions.
Developer workflow
Install from Packagist with Composer. Releases use the SDK tag scheme, so use the dev version constraint shown below.
composer require crawlora/sdk:^1.5@dev
Developer workflow
export CRAWLORA_API_KEY="your_api_key_here"
Developer workflow
Construct a client, then call grouped endpoint helpers or the dynamic operation interface.
<?php
require 'vendor/autoload.php';
use Crawlora\Client;
// Reads CRAWLORA_API_KEY from the environment if apiKey is omitted.
$client = new Client(['apiKey' => getenv('CRAWLORA_API_KEY') ?: '']);
$result = $client->bing->search(['q' => 'coffee shops']);
foreach ($result['data'] as $item) {
echo $item['title'] ?? '', "\n";
}
$client->close(); // release the pooled curl connectionDeveloper workflow
Use cURL directly for a minimal dependency path, or to compare behavior with endpoint docs before adding the SDK.
<?php
$apiKey = getenv('CRAWLORA_API_KEY');
$baseUrl = 'https://api.crawlora.net/api/v1';
function crawloraRequest(string $path, array $query, string $apiKey, string $baseUrl): array {
$ch = curl_init($baseUrl . $path . '?' . http_build_query($query));
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'x-api-key: ' . $apiKey,
],
CURLOPT_TIMEOUT => 60,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($status >= 300) {
throw new RuntimeException("Crawlora request failed: {$status} {$body}");
}
return json_decode($body, true);
}
$data = crawloraRequest('/bing/search', [
'q' => 'best CRM software',
'country' => 'us',
], $apiKey, $baseUrl);
print_r($data);Developer workflow
Proxy browser requests through a server-side route so the API key never reaches client-side code.
// routes/api.php
use Crawlora\Client;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
Route::post('/search', function (Request $request) {
$keyword = trim((string) $request->input('keyword', ''));
if ($keyword === '') {
return response()->json(['error' => 'keyword is required'], 400);
}
// Reads CRAWLORA_API_KEY from the environment if apiKey is omitted.
$client = new Client();
$result = $client->bing->search(['q' => $keyword]);
return response()->json($result);
});Developer workflow
Keep batch output simple by writing JSONL from grouped SDK calls, one line per keyword.
<?php
require 'vendor/autoload.php';
use Crawlora\Client;
$client = new Client();
$keywords = ['project management software', 'crm for startups', 'sales automation'];
$output = fopen('crawlora-search-results.jsonl', 'w');
foreach ($keywords as $keyword) {
try {
$result = $client->bing->search(['q' => $keyword]);
fwrite($output, json_encode(['keyword' => $keyword, 'response' => $result]) . "\n");
} catch (\Throwable $exc) {
fwrite($output, json_encode(['keyword' => $keyword, 'error' => $exc->getMessage()]) . "\n");
}
}
fclose($output);
$client->close();Developer workflow
Check the response status before reading the body — the status codes below are common integration patterns for the PHP client. Endpoint detail pages list documented failure responses where available.
| Status / code | Meaning | How to handle |
|---|---|---|
| 400 | Invalid request or missing required input. | Validate request bodies before calling Crawlora and surface useful messages to users. |
| 401 | Missing or invalid API key. | Check the `x-api-key` header and rotate the key from the console if needed. |
| 402/403 | Plan, permission, or billing issue where applicable. | Check plan access, credit state, and endpoint availability. |
| 429 | Rate limit exceeded. | Back off with jitter and reduce concurrency. |
| 5xx | Temporary execution or upstream failure. | Retry safe jobs with exponential backoff and keep the failure visible. |
Developer workflow
Use Crawlora for structured public web data workflows. Customers are responsible for compliance with applicable laws, third-party rights, platform rules, and Crawlora terms. Keep API keys server-side, validate inputs, and avoid collecting or storing unnecessary sensitive data.
Read Crawlora termsDeveloper workflow
Use these pages to move between endpoint discovery, examples, pricing, and responsible-use guidance.
Developer workflow
Common questions for this Crawlora developer integration path.
Yes. The official PHP beta SDK is published to Packagist as crawlora/sdk and developed at https://github.com/Crawlora-org/crawlora-php-sdk. Install it with composer require crawlora/sdk:^1.5@dev.
PHP 8.1 or newer with the curl and json extensions. The SDK has no other runtime dependencies.
Releases are aliased from the main branch using the -sdk.N tag scheme, which is not a standard Composer version, so the ^1.5@dev constraint resolves the current beta.
Pass apiKey when constructing the Client, or omit it to read CRAWLORA_API_KEY from the environment. JWT authorization is also supported.
Yes. Register the client in your service container or instantiate it directly; it is a plain PHP client with no framework coupling — see the Laravel route example above.
Construct one client, loop your keyword list, and write each result (or error) as a JSON line — see the scheduled batch job example above. Wire it to Laravel's scheduler or a cron entry to run on a cadence.
Open the endpoint detail page from the docs catalog to inspect request parameters, examples, and schema references.
Require crawlora/sdk from Packagist, set CRAWLORA_API_KEY, then inspect endpoint docs for platform-specific schemas.