Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Use Imagga API Sample
<?php
use Curl\Curl;
$curl_url = "https://api.imagga.com/v1/tagging"
$curl = new Curl();
$curl->setopt(CURLOPT_HEADER, FALSE);
$curl->setopt(CURLOPT_RETURNTRANSFER, TRUE);
$curl->setBasicAuthentication($api_key, $api_secret);
$curl->get($curl_url, array(
'url' => $file,
'language' => 'ja'
));
$response = json_decode($curl->response);
$results = $response->results;
$tags = $results[0]->tags;
foreach ($tags as $tag) {
echo "confidence : " . $tag->confidence . " tag : " . $tag->tag . "\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.