https://github.com/fabriceclementz/clarifai-php
A simple Clarifai PHP client.
https://github.com/fabriceclementz/clarifai-php
clarifai clarifai-api client php php7
Last synced: 6 months ago
JSON representation
A simple Clarifai PHP client.
- Host: GitHub
- URL: https://github.com/fabriceclementz/clarifai-php
- Owner: fabriceclementz
- License: mit
- Created: 2017-02-14T20:18:54.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-04-21T11:39:29.000Z (about 5 years ago)
- Last Synced: 2024-11-04T01:04:48.779Z (7 months ago)
- Topics: clarifai, clarifai-api, client, php, php7
- Language: PHP
- Size: 12.7 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Clarifai API Client
[](https://packagist.org/packages/fabriceclementz/clarifai-php)
[](https://packagist.org/packages/fabriceclementz/clarifai-php)
[](https://packagist.org/packages/fabriceclementz/clarifai-php)
[](https://travis-ci.org/fabriceclementz/clarifai-php)
[](https://travis-ci.org/fabriceclementz/clarifai-php)
[](https://scrutinizer-ci.com/g/fabriceclementz/clarifai-php/?branch=master)A PHP client for the [Clarifai API](https://developer.clarifai.com).
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
```