Skip to content

Latest commit

 

History

History
48 lines (36 loc) · 900 Bytes

index.md

File metadata and controls

48 lines (36 loc) · 900 Bytes

DOCUMENTATION

Search images

// Create the API provider.
$provider = new ApiProvider("YOUR_API_KEY");

// Create a Search images request.
$request = new SearchImagesRequest();
// ...

// Call the API and get the response.
$response = $provider->searchImages($request);

// Handle the response.
$response->getTotal();
$response->getTotalHits();

/** @var ImageHit $current */
foreach ($response->getImageHits() as $current) {
    // ...
}

Search videos

// Create the API provider.
$provider = new ApiProvider("YOUR_API_KEY");

// Create a Search videos request.
$request = new SearchVideosRequest();
// ...

// Call the API and get the response.
$response = $provider->searchVideos($request);

// Handle the response.
$response->getTotal();
$response->getTotalHits();

/** @var VideoHit $current */
foreach ($response->getImageHits() as $current) {
    // ...
}