imageseo/imageseo-php

PHP library for the ImageSeo API

v1.0.7 2020-02-08 15:31 UTC

This package is auto-updated.

Last update: 2024-04-09 00:32:02 UTC


README

68747470733a2f2f696d61676573656f2e696f2f77702d636f6e74656e742f7468656d65732f696d61676573656f2f7374617469632f696d672f6c6f676f2d746578742d636f6c6f722e737667

ImageSEO SDK PHP

Official PHP SDK of the ImageSEO API. This allows you to use our API: https://imageseo.io

API Documentation : https://docs.imageseo.io/

Requirements

  • PHP version 5.6 and later
  • ImageSEO API Key, starting at free level

Installation

You can install the library via Composer. Run the following command:

composer require imageseo/imageseo-php

To use the library, use Composer's autoload:

require_once __DIR__. '/vendor/autoload.php';

Resources

View all ressources : https://docs.imageseo.io/resources

  • Projects :

    • getOwner()
  • ImageReports

    • generateReportFromUrl($data,$query = null)
    • generateReportFromFile($data,$query = null)
  • Languages

    • getLanguages()

Example

Authentication

<?php

use ImageSeo\Client\Client;

$apiKey = "YOUR_API_KEY";
$client =new Client($apiKey);

Resources

Our SDK operates on the principle of resources. You must choose the resource on which you want to make an API call in order to use different methods. See the list of our resources

Image Reports

Example : Generate an image report from URL

<?php

use ImageSeo\Client\Client;

$apiKey = "YOUR_API_KEY";
$client =new Client($apiKey);

$data = [
    "src": "https://example.com/image.jpg"
];
$report = $client->getResource('ImageReports')->generateReportFromUrl($data);

Example : Generate an image report from file

<?php

use ImageSeo\Client\Client;

$apiKey = "YOUR_API_KEY";
$client =new Client($apiKey);

$data = [
    "filePath": "/path/your/image.jpg"
];
$report = $client->getResource('ImageReports')->generateReportFromFile($data);

Languages

Get languages available

<?php

use ImageSeo\Client\Client;

$apiKey = "YOUR_API_KEY";
$client =new Client($apiKey);

$report = $client->getResource('Languages')->getLanguages();

About

imageseo-php is guided and supported by the ImageSEO Developer Team.

License

The MIT License (MIT)