Download the PHP package j0k3r/php-imgur-api-client without Composer
On this page you can find all versions of the php package j0k3r/php-imgur-api-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download j0k3r/php-imgur-api-client
More information about j0k3r/php-imgur-api-client
Files in j0k3r/php-imgur-api-client
Package php-imgur-api-client
Short Description Imgur API v3 client
License MIT
Homepage https://github.com/j0k3r/php-imgur-api-client
Informations about the package php-imgur-api-client
PHP Imgur API Client
Object Oriented PHP wrapper for the Imgur API.
Uses Imgur API v3.
Information
- Branch 1.x use Guzzle 3 (but is not maintained)
- Branch 2.x use Guzzle 5 (but is not maintained)
- Branch 3.x use Guzzle 6 and PHP >= 5.6
- Branch master use Guzzle 7 and PHP >= 7.4
Composer
Download Composer
Add the library details to your composer.json
Install the dependency with
Basic usage
The API calls can be accessed via the $client
object
Documentation
Basic information
This client follow the same tree as the Imgur API.
Here is the list of available endpoints: account
, album
, comment
, custom gallery
, gallery
, image
, conversation
, notification
, memegen
& topic
.
You can access each endpoint using the api()
method:
All available methods for each endpoints are in the folder Api. They mostly follow the description name in the Imgur doc. Here are few examples:
Uploading an image
If you want to upload an image you can use one of these solutions:
or
or
Pagination
For any API call that supports pagination and is not explicitly available via the method parameters, it can be achieved by using the BasicPager
object and passing it as the second parameter in the api()
call.
Here is a real life example if you want to retrieve all your available images of an account:
This pager is really basic:
- You won't have information about how many pages are available
- If you request a non-existant page, you'll get an empty array
NOTE: /gallery
endpoints do not support the perPage
query string, and /album/{id}/images
is not paged.
Please, read the Imgur doc about it.
Image id or Album id ?
When you got an Imgur link it's almost impossible to be 100% sure if it's an image or an album. That's why we have an endpoint which might fix that by first checking an id as an image and if it's fail, test it as an album:
License
php-imgur-api-client
is licensed under the MIT License - see the LICENSE file for details