Install
Scrape a page
Save this asscrape.php beside your vendor directory and run php scrape.php. It prints the page as Markdown, starting with # Example Domain.
scrape.php
camelCase field names.
Look up a brand
The generated Brand helper requires the fields of every lookup type at once, so it can’t send a single lookup such asby_domain. Use the SDK’s low-level request method instead. It keeps the SDK’s authentication, retries, and error handling, and every PHP Brand example in these docs uses it.
Save this as brand.php and run php brand.php. It prints the company name.
brand.php
brand/retrieve, with no leading slash) so the request keeps the /v1 base path. The method returns the raw HTTP response, so decode the body yourself.
Notes
- Set
timeoutin seconds andmaxRetrieson the client:new Client(requestOptions: ['timeout' => 120, 'maxRetries' => 0]). - If
$client->web->scrapedoesn’t accept an option you need, such ashighlightsParams,jsonParams, orproductParams, your installed version predates it. Send the request with$client->request(method: 'post', path: 'web/scrape', body: [...]).