fabriceclementz/clarifai-php

A PHP client for the Clarifai API.

Installs: 2 688

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 1

Forks: 2

Open Issues: 1

pkg:composer/fabriceclementz/clarifai-php

v0.1.0 2017-02-19 15:46 UTC

This package is not auto-updated.

Last update: 2025-10-26 07:42:39 UTC


README

Latest Stable Version Total Downloads License Build Status Build Status Scrutinizer Code Quality

A PHP client for the Clarifai API.

Work in progress.

Installation

Via composer

composer require fabriceclementz/clarifai-php

Usage

Fetch an access token

use GuzzleHttp\Client as HttpClient;
use Fab\Clarifai\Client;

// Instantiate a new client.
$client = new Client(new HttpClient(), 'CLIENT_ID', 'CLIENT_SECRET');

// Fetch an access token.
$response = $client->accessToken();

Predict the content of an image

$response = $client
    ->withAccessToken($response['access_token'])
    ->predict(['https://samples.clarifai.com/metro-north.jpg']);

Testing

composer test