# Introduction

Welcome to ImageSEO API. You can use the API to analyze your images and improve your SEO!

List of our SDKs

{% hint style="info" %}
&#x20;If you would like to develop or need an SDK in a language that we do not yet support, please do not hesitate to contact us
{% endhint %}

* [PHP](/api-librairies/php)


# 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

* [Image Reports](/resources/image-reports)
* [Projects](/resources/projects)


# Languages

Resource Languages

## Get Languages available

<mark style="color:blue;">`GET`</mark> `https://api.imageseo.io/v1/public/langs`

{% tabs %}
{% tab title="200 " %}

```
{
    "success": true,
    "result": [
        {
            "code": "af",
            "name": "Afrikaans"
        },
        {
            "code": "sq",
            "name": "Albanian"
        },
        {
            "code": "am",
            "name": "Amharic"
        },
        {
            "code": "ar",
            "name": "Arabic"
        },
        {
            "code": "hy",
            "name": "Armenian"
        },
        {
            "code": "az",
            "name": "Azerbaijani"
        },
        {
            "code": "eu",
            "name": "Basque"
        }
        // ...
    ]
}
```

{% endtab %}
{% endtabs %}


# Image Reports

Resource Image Reports

## Generate Image Report

<mark style="color:green;">`POST`</mark> `https://api.imageseo.io/v1/external/projects/images`

This endpoint allows you to analyze the URL of an image or image file. One of the two is required (**imageFile** or **src)**

#### Headers

| Name           | Type   | Description      |
| -------------- | ------ | ---------------- |
| Authentication | string | {YOUR\_API\_KEY} |

#### Request Body

| Name      | Type   | Description                                                                   |
| --------- | ------ | ----------------------------------------------------------------------------- |
| lang      | string | Example : 'fr'. You can find the list of languages supported on /public/langs |
| imageFile | object | Image FILE ( Corresponds to a file )                                          |
| src       | string | Image URL                                                                     |

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}

```javascript
{
    "success": true,
    "result": {
        "labels": [
            {
                "name": "Moths and butterflies",
                "score": 99.42726492881775,
                "entity": "/m/0d_2m",
                "link_google": "https://www.google.com/search?q=Moths and butterflies"
            }
        ],
        "alts": [
            {
                "name": "Operations management",
                "score": 71.43999934196472,
                "entity": "/m/06ck9d",
                "scoring": 0.7143999934196472,
                "link_google": "https://www.google.com/search?q=Operations management&tbm=isch"
            },
            {
                "name": "Management",
                "score": 63.349997997283936,
                "entity": "/m/04_tv",
                "scoring": 0.6334999799728394,
                "link_google": "https://www.google.com/search?q=Management&tbm=isch"
            }
        ]
        "src": "https://example.com/image",
        "height": "",
        "width": "",
        "weight": "224662",
        "encoding": null,
        "type": "URL"
    }
}
```

{% endtab %}

{% tab title="404 Could not find a cake matching this query." %}

```javascript
{
    "success": false,
    "code": "no_report"
}
```

{% endtab %}
{% endtabs %}

### Deprecated

Keys in the response are depreciated and should not be used.

* `alt` (use `alts` array)
* `a_vision`


# Projects

Resource Project

## Get Owner Info

<mark style="color:blue;">`GET`</mark> `https://api.imageseo.io/v1/external/projects/owner`

This endpoint returns you the information of the user who owns the API Key

#### Headers

| Name           | Type   | Description      |
| -------------- | ------ | ---------------- |
| Authentication | string | {YOUR\_API\_KEY} |

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}

```javascript
{
    "success": true,
    "result": {
        "isActive": true,
        "current_request_images": 0,
        "bonus_stock_images": 0,
        "start_timelimit": "1555688843",
        "plan": {
            "slug": "free",
            "id": "plan_EDib7AIypKXJHN",
            "type": "month",
            "limit_images": 20,
            "limit_projects": 1,
            "price": 0,
            "name": "Free"
        },
        "id": "5cb9ed8bfc92d3af76324ef1"
    }
}
```

{% endtab %}

{% tab title="404 Not found" %}

```javascript
{
    "success": false,
    "code": "not_exist"
}
```

{% endtab %}
{% endtabs %}


# PHP

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

## Requirements

* PHP version 5.6 and later
* ImageSEO API Key, starting at [free level](https://app.imageseo.io/register)

## Installation

You can install the library via [Composer](https://getcomposer.org/). Run the following command:

```bash
composer require imageseo/imageseo-php
```

To use the library, use Composer's [autoload](https://getcomposer.org/doc/01-basic-usage.md#autoloading):

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

### Getting Started

#### Authentication

```php
<?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](/resources)

### Image Reports

Example : Generate an image report from URL

```php
<?php

use ImageSeo\Client\Client;

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

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

Example : Generate an image report from file

```php
<?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);
```


