Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 2 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 (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-04-21T11:39:29.000Z (over 4 years ago)
- Last Synced: 2024-11-04T01:04:48.779Z (2 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
[![Latest Stable Version](https://poser.pugx.org/fabriceclementz/clarifai-php/v/stable)](https://packagist.org/packages/fabriceclementz/clarifai-php)
[![Total Downloads](https://poser.pugx.org/fabriceclementz/clarifai-php/downloads)](https://packagist.org/packages/fabriceclementz/clarifai-php)
[![License](https://poser.pugx.org/fabriceclementz/clarifai-php/license)](https://packagist.org/packages/fabriceclementz/clarifai-php)
[![Build Status](https://travis-ci.org/fabriceclementz/clarifai-php.svg?branch=master)](https://travis-ci.org/fabriceclementz/clarifai-php)
[![Build Status](https://travis-ci.org/fabriceclementz/clarifai-php.svg?branch=master)](https://travis-ci.org/fabriceclementz/clarifai-php)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/fabriceclementz/clarifai-php/badges/quality-score.png?b=master)](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
```