PHP
https://github.com/ImageSEO/imageseo-php

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:
1
composer require imageseo/imageseo-php
Copied!
To use the library, use Composer's autoload:
1
require_once __DIR__. '/vendor/autoload.php';
Copied!

Getting Started

Authentication

1
<?php
2
3
use ImageSeo\Client\Client;
4
5
$apiKey = "YOUR_API_KEY";
6
$client =new Client($apiKey);
Copied!

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
1
<?php
2
3
use ImageSeo\Client\Client;
4
5
$apiKey = "YOUR_API_KEY";
6
$client =new Client($apiKey);
7
8
$data = [
9
"url": "https://example.com/image.jpg"
10
];
11
$report = $client->getResource('ImageReports')->generateReportFromUrl($data);
Copied!
Example : Generate an image report from file
1
<?php
2
3
use ImageSeo\Client\Client;
4
5
$apiKey = "YOUR_API_KEY";
6
$client =new Client($apiKey);
7
8
$data = [
9
"filePath": "/path/your/image.jpg"
10
];
11
$report = $client->getResource('ImageReports')->generateReportFromFile($data);
Copied!
Last modified 2yr ago