NAV Navbar
Logo
HTTP cURL jQuery Node.JS Java Python Ruby

Image Resizer API v1

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

This document describes all the available API calls for ImageResizer.io when creating, updating, finding and deleting images.

For documentation on serving raw and transformed images once uploaded into your Image Resizer hosted storage, please visit the ImageResizer.io home page.

Swagger / OpenAPI specification can be downloaded here.

Base URL

https://api.imageresizer.io/v1

This is the base URL used for all API requests described in this document. It consists of:

Authentication

Your API key

YOUR_API_KEY

WARNING: The examples on this page use your real API key.

You may choose any of the following methods to authenticate with the Image Resizer API:


You can sign up for an API key here.

Images

The following section describes how to create, update, search and delete images in your Image Resizer.io account.

Click here for documentation on perfoming image manipulations and transforms once uploaded.

Create (from URL)

# You can also use wget
curl -X get https://api.imageresizer.io/v1/images?key=YOUR_API_KEY&url=https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2F6%2F65%2FTesla_Model_S_Indoors.jpg

GET https://api.imageresizer.io/v1/images?key=YOUR_API_KEY&url=https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2F6%2F65%2FTesla_Model_S_Indoors.jpg HTTP/1.1
Host: api.imageresizer.io

Accept: application/json


$.ajax({
  url: 'https://api.imageresizer.io/v1/images',
  method: 'get',
  data: '?key=YOUR_API_KEY&url=https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2F6%2F65%2FTesla_Model_S_Indoors.jpg',

  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');

fetch('https://api.imageresizer.io/v1/images?key=YOUR_API_KEY&url=https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2F6%2F65%2FTesla_Model_S_Indoors.jpg',
{
  method: 'GET'

})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'


result = RestClient.get 'https://api.imageresizer.io/v1/images', params: { 
    'key' => 'YOUR_API_KEY',
    'url' => 'https://upload.wikimedia.org/wikipedia/commons/6/65/Tesla_Model_S_Indoors.jpg'
}

p JSON.parse(result)
import requests

r = requests.get('https://api.imageresizer.io/v1/images', params={ 
  'key': 'YOUR_API_KEY',
  'url': 'https://upload.wikimedia.org/wikipedia/commons/6/65/Tesla_Model_S_Indoors.jpg'
})

print r.json()
URL obj = new URL("https://api.imageresizer.io/v1/images?key=YOUR_API_KEY&url=https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2F6%2F65%2FTesla_Model_S_Indoors.jpg");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /images

Saves an image into your Image Resizer online hosted storage using a source image which is publicly accessible via an HTTP or HTTPS URL.

Query String Parameters

Parameter Type Required Description
key string true Your API key
url string true Publicly accessible URL of the source image you would like to copy to your local storage
tags string false Comma separated list of tags to add to the image
with_exif boolean false Also return image EXIF data
verbose boolean false Include extra image data like image format and created time
with_mini_preview boolean false Response will include a base64 encoded tiny JPEG thumbnail of the image (about 500 bytes), which can be used together with CSS blurring to show to your users before the full image has loaded
with_account boolean false Also return basic account information

Responses

Example response

{
  "success": true,
  "response": {
    "id": "NKrigl4",
    "width": 5054,
    "height": 3369,
    "filesize": 3369,
    "tags": []
  }
}
Status Meaning Description
200 OK Image successfully saved in your hosted storage

Create (from file)

# You can also use wget
curl -X post https://api.imageresizer.io/v1/images?key=YOUR_API_KEY \
  -H 'Content-Type: application/octet-stream'

POST https://api.imageresizer.io/v1/images?key=YOUR_API_KEY HTTP/1.1
Host: api.imageresizer.io

Accept: application/json
Content-Type: application/octet-stream

var headers = {
  'Content-Type':'application/octet-stream'

};

$.ajax({
  url: 'https://api.imageresizer.io/v1/images',
  method: 'post',
  data: '?key=YOUR_API_KEY',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const inputBody = '{}';
const headers = {
  'Content-Type':'application/octet-stream'

};

fetch('https://api.imageresizer.io/v1/images?key=YOUR_API_KEY',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/octet-stream'
}

result = RestClient.post 'https://api.imageresizer.io/v1/images', params: { 
    'key' => 'YOUR_API_KEY'
}, headers: headers

p JSON.parse(result)
import requests
headers = {
  'Content-Type': 'application/octet-stream'
}

r = requests.post('https://api.imageresizer.io/v1/images', params={ 
  'key': 'YOUR_API_KEY'
}, headers=headers)

print r.json()
URL obj = new URL("https://api.imageresizer.io/v1/images?key=YOUR_API_KEY");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /images

Create a new image and store it in your hosted storage.

Query String Parameters

Parameter Type Required Description
key string true Your API key
tags string false Comma separated list of tags to add to the image
with_exif boolean false Also return image EXIF data
verbose boolean false Include extra image data like image format and created time
with_mini_preview boolean false Response will include a base64 encoded tiny JPEG thumbnail of the image (about 500 bytes), which can be used together with CSS blurring to show to your users before the full image has loaded
with_account boolean false Also return basic account information

HTTP Headers

Header Required Description
Content-Type true Must be set to application/octet-stream

Request Body

Field Type Required Description
Body binary true Binary data of the image you want to store in your hosted storage.

Responses

Example response

{
  "success": true,
  "response": {
    "id": "NKrigl4",
    "width": 5054,
    "height": 3369,
    "filesize": 3369,
    "tags": []
  }
}
Status Meaning Description
200 OK Image successfully saved in your hosted storage

Get image

# You can also use wget
curl -X get https://api.imageresizer.io/v1/images/{IMAGE_ID}?key=YOUR_API_KEY

GET https://api.imageresizer.io/v1/images/{IMAGE_ID}?key=YOUR_API_KEY HTTP/1.1
Host: api.imageresizer.io

Accept: application/json


$.ajax({
  url: 'https://api.imageresizer.io/v1/images/{IMAGE_ID}',
  method: 'get',
  data: '?key=YOUR_API_KEY',

  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');

fetch('https://api.imageresizer.io/v1/images/{IMAGE_ID}?key=YOUR_API_KEY',
{
  method: 'GET'

})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'


result = RestClient.get 'https://api.imageresizer.io/v1/images/{IMAGE_ID}', params: { 
    'key' => 'YOUR_API_KEY'
}

p JSON.parse(result)
import requests

r = requests.get('https://api.imageresizer.io/v1/images/{IMAGE_ID}', params={ 
  'key': 'YOUR_API_KEY'
})

print r.json()
URL obj = new URL("https://api.imageresizer.io/v1/images/{IMAGE_ID}?key=YOUR_API_KEY");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /images/{IMAGE_ID}

Retrieves metadata for an existing image.

Path Parameters

Parameter Type Required Description
IMAGE_ID string true Image ID to retrieve metadata for

Query String Parameters

Parameter Type Required Description
key string true Your API key
with_exif boolean false Also return image EXIF data
verbose boolean false Include extra image data like image format and created time
with_mini_preview boolean false Response will include a base64 encoded tiny JPEG thumbnail of the image (about 500 bytes), which can be used together with CSS blurring to show to your users before the full image has loaded
with_account boolean false Also return basic account information

Responses

Example response

{
  "success": true,
  "response": {
    "id": "NKrigl4",
    "width": 5054,
    "height": 3369,
    "filesize": 3369,
    "tags": []
  }
}
Status Meaning Description
200 OK Successful operation

Delete image

# You can also use wget
curl -X get https://api.imageresizer.io/v1/images/{IMAGE_ID}/delete?key=YOUR_API_KEY

GET https://api.imageresizer.io/v1/images/{IMAGE_ID}/delete?key=YOUR_API_KEY HTTP/1.1
Host: api.imageresizer.io

Accept: application/json


$.ajax({
  url: 'https://api.imageresizer.io/v1/images/{IMAGE_ID}/delete',
  method: 'get',
  data: '?key=YOUR_API_KEY',

  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');

fetch('https://api.imageresizer.io/v1/images/{IMAGE_ID}/delete?key=YOUR_API_KEY',
{
  method: 'GET'

})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'


result = RestClient.get 'https://api.imageresizer.io/v1/images/{IMAGE_ID}/delete', params: { 
    'key' => 'YOUR_API_KEY'
}

p JSON.parse(result)
import requests

r = requests.get('https://api.imageresizer.io/v1/images/{IMAGE_ID}/delete', params={ 
  'key': 'YOUR_API_KEY'
})

print r.json()
URL obj = new URL("https://api.imageresizer.io/v1/images/{IMAGE_ID}/delete?key=YOUR_API_KEY");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /images/{IMAGE_ID}/delete

Deletes an image from your hosted storage.

NOTE: Images recently served may continue serving until their cache expiry time is reached.

Path Parameters

Parameter Type Required Description
IMAGE_ID string true ID of single image or comma separated IDs of multiple images. Supports up to 20 images at once.

Query String Parameters

Parameter Type Required Description
key string true Your API key

Responses

Example response

{
  "success": true,
  "response": {
    "id": "NKrigl4",
    "width": 5054,
    "height": 3369,
    "filesize": 3369,
    "tags": []
  }
}
Status Meaning Description
200 OK Successful deletion
400 Bad Request Invalid image ID supplied

Adding tags

# You can also use wget
curl -X get https://api.imageresizer.io/v1/images/{IMAGE_ID}/add_tags?tags=animal%2Cdog%2Cpet%2Cfour_legs

GET https://api.imageresizer.io/v1/images/{IMAGE_ID}/add_tags?tags=animal%2Cdog%2Cpet%2Cfour_legs HTTP/1.1
Host: api.imageresizer.io

Accept: application/json


$.ajax({
  url: 'https://api.imageresizer.io/v1/images/{IMAGE_ID}/add_tags',
  method: 'get',
  data: '?tags=animal%2Cdog%2Cpet%2Cfour_legs',

  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');

fetch('https://api.imageresizer.io/v1/images/{IMAGE_ID}/add_tags?tags=animal%2Cdog%2Cpet%2Cfour_legs',
{
  method: 'GET'

})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'


result = RestClient.get 'https://api.imageresizer.io/v1/images/{IMAGE_ID}/add_tags', params: { 
    'tags' => 'animal,dog,pet,four_legs'
}

p JSON.parse(result)
import requests

r = requests.get('https://api.imageresizer.io/v1/images/{IMAGE_ID}/add_tags', params={ 
  'tags': 'animal,dog,pet,four_legs'
})

print r.json()
URL obj = new URL("https://api.imageresizer.io/v1/images/{IMAGE_ID}/add_tags?tags=animal%2Cdog%2Cpet%2Cfour_legs");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /images/{IMAGE_ID}/add_tags

Add one or more tags to an image. Each image can have up to 20 associated tags.

Path Parameters

Parameter Type Required Description
IMAGE_ID string true ID of single image or comma separated IDs of multiple images. Supports up to 20 images at once.

Query String Parameters

Parameter Type Required Description
tags string true Comma separated list of tags to add to the image(s)

Responses

Example response

{
  "success": true,
  "response": {
    "id": "NKrigl4",
    "width": 5054,
    "height": 3369,
    "filesize": 3369,
    "tags": [
      "animal",
      "dog",
      "pet",
      "four_legs"
    ]
  }
}
Status Meaning Description
200 OK Tags added successfully

Removing tags

# You can also use wget
curl -X get https://api.imageresizer.io/v1/images/{IMAGE_ID}/remove_tags?tags=animal%2Cdog%2Cpet%2Cfour_legs

GET https://api.imageresizer.io/v1/images/{IMAGE_ID}/remove_tags?tags=animal%2Cdog%2Cpet%2Cfour_legs HTTP/1.1
Host: api.imageresizer.io

Accept: application/json


$.ajax({
  url: 'https://api.imageresizer.io/v1/images/{IMAGE_ID}/remove_tags',
  method: 'get',
  data: '?tags=animal%2Cdog%2Cpet%2Cfour_legs',

  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');

fetch('https://api.imageresizer.io/v1/images/{IMAGE_ID}/remove_tags?tags=animal%2Cdog%2Cpet%2Cfour_legs',
{
  method: 'GET'

})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'


result = RestClient.get 'https://api.imageresizer.io/v1/images/{IMAGE_ID}/remove_tags', params: { 
    'tags' => 'animal,dog,pet,four_legs'
}

p JSON.parse(result)
import requests

r = requests.get('https://api.imageresizer.io/v1/images/{IMAGE_ID}/remove_tags', params={ 
  'tags': 'animal,dog,pet,four_legs'
})

print r.json()
URL obj = new URL("https://api.imageresizer.io/v1/images/{IMAGE_ID}/remove_tags?tags=animal%2Cdog%2Cpet%2Cfour_legs");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /images/{IMAGE_ID}/remove_tags

Remove one or more tags from an image.

Path Parameters

Parameter Type Required Description
IMAGE_ID string true ID of single image or comma separated IDs of multiple images. Supports up to 20 images at once.

Query String Parameters

Parameter Type Required Description
tags string true Comma separated list of tags to remove from the image(s)

Responses

Example response

{
  "success": true,
  "response": {
    "id": "NKrigl4",
    "width": 5054,
    "height": 3369,
    "filesize": 3369,
    "tags": []
  }
}
Status Meaning Description
200 OK Tags removed successfully

Search images

# You can also use wget
curl -X get https://api.imageresizer.io/v1/search

GET https://api.imageresizer.io/v1/search HTTP/1.1
Host: api.imageresizer.io

Accept: application/json


$.ajax({
  url: 'https://api.imageresizer.io/v1/search',
  method: 'get',

  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');

fetch('https://api.imageresizer.io/v1/search',
{
  method: 'GET'

})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'


result = RestClient.get 'https://api.imageresizer.io/v1/search', params: { 
}

p JSON.parse(result)
import requests

r = requests.get('https://api.imageresizer.io/v1/search')

print r.json()
URL obj = new URL("https://api.imageresizer.io/v1/search");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /search

Search/list images stored in your ImageResizer.io hosted storage.

NOTE: This is a BETA feature. Its implementation may change before being made generally available and will not be covered by any SLA while in beta.

Query String Parameters

Parameter Type Required Description
query string false Optional URL-encoded query string used to filter search results. You can filter images by the following properties: id, tag, width, height, filesize, megapixels and format.

Supports the following conditionals: AND, OR and NOT.

Example query:
tag=(cat OR dog) AND width>1000
sort string false Specify the order of returned search results. Allowed values are created, -created, filesize, -filesize, megapixels, and -megapixels. If not specified, defaults to -created (that is, newest images are returned first).
page_id string false The value of next_page_id, as returned in the response of the previous search results page. If page_id is specified, you do not need to specify the search query (query) or the sort order (sort) as these will be inherited from the previous page.

Responses

Example response

{
  "success": true,
  "response": {
    "next_page_id": "kj9jnv0zzmwnasd3kwkndwas426z....",
    "images": [
      {
        "id": "3Z6ikyly",
        "width": 3867,
        "height": 2578,
        "filesize": 3857796,
        "tags": [
          "animal",
          "cute",
          "dog",
          "domestic",
          "field",
          "fur",
          "grass",
          "little",
          "mammal",
          "nature",
          "outdoors",
          "pet"
        ]
      },
      {
        "id": "rj1ikyl9",
        "width": 6016,
        "height": 4016,
        "filesize": 10336873,
        "tags": [
          "animal",
          "cat",
          "cute",
          "domestic",
          "fur",
          "looking",
          "mammal",
          "nature",
          "pet"
        ]
      },
      {
        "id": "...etc..."
      }
    ]
  }
}
Status Meaning Description
200 OK Search results returned successfully.

Account

The following section describes operations for retrieving basic information about your account.

Get account

# You can also use wget
curl -X get https://api.imageresizer.io/v1/account?key=YOUR_API_KEY

GET https://api.imageresizer.io/v1/account?key=YOUR_API_KEY HTTP/1.1
Host: api.imageresizer.io

Accept: application/json


$.ajax({
  url: 'https://api.imageresizer.io/v1/account',
  method: 'get',
  data: '?key=YOUR_API_KEY',

  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');

fetch('https://api.imageresizer.io/v1/account?key=YOUR_API_KEY',
{
  method: 'GET'

})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'


result = RestClient.get 'https://api.imageresizer.io/v1/account', params: { 
    'key' => 'YOUR_API_KEY'
}

p JSON.parse(result)
import requests

r = requests.get('https://api.imageresizer.io/v1/account', params={ 
  'key': 'YOUR_API_KEY'
})

print r.json()
URL obj = new URL("https://api.imageresizer.io/v1/account?key=YOUR_API_KEY");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /account

Retrieve basic account information like number of images in hosted storage and storage used / remaining.

It may take up to one minute for recently created or deleted images to be included in the values returned.

Query String Parameters

Parameter Type Required Description
key string true Your API key

Responses

Example response

{
  "success": true,
  "response": {
    "num_images": 42,
    "storage": {
      "max": 2147483648,
      "max_readable": "2 GB",
      "used": 112332108,
      "used_readable": "107 MB",
      "remaining": 2035151540,
      "remaining_readable": "1.9 GB"
    }
  }
}
Status Meaning Description
200 OK successful operation