Using our JS library

Easier and recommended option for using Imgsrc.space. Include our js library and use our api from comfort of your code editor. Can be only used for web apps written in HTML and Javascript.

Using direct URL

Get photos and videos using our direct url endpoint. You can get images and videos from anywhere using this option. No language or Platform boundary. Can also be used in writing blog posts easily.


Getting started

This document describes the resources that make up the official ImgSrc.Space API.

If you have any problems or requests, please contact our API team.

Using our JS library

<script src="https://cdn.jsdelivr.net/gh/imgsrc-space/imgsrc.space-js-library/main.js" > </script>

Copy and paste the above script tag to the TOP of your html page (in the head tag), and that's it.

USAGE

Below are the different options you get with our javascript library.

Getting a specific image

To get a specific image just enter the search word in the image source after a dot and a space

<img src=". cow" >
<img src=". architecture" >
<img src=". cute dog" >

Resizing images

Imgsrc.space can also resize the images for you. To enter your desired dimensions put an "?" at the end of the search term and then your enter your desired height and width. Here "h" stands for height and w stands for width. They must be separated by an &

<img src=". cow?h=500&w=70" >
<img src=". architecture?h=250&w=250" >

AutoResizing images

If you only provide a single dimension parameter (i.e only height or width) Imgsrc.Space would automatically resize the other parameters accordingly

<img src=". cat?h=500" >
<img src=". sunset?w=700" >


Getting a specific Video

To get a specific image just enter the search word in the image source after a dot and a space followed by an -v

<video> <source src=". car-v" type="video/mp4"> </video>
<video> <source src=". big mountain-v" type="video/mp4"> </video>
<video> <source src=". river-v" type="video/mp4"> </video>

Common errors and trouble shooting

Images are not loading?

Images are not resizing?

Videos are not loading?

Using direct URL

https://imgsrc.space/

The above is our image and video end point.

USAGE

Below are the different options you get with our URL.

Getting a specific image

To get a specific image just enter the search word after /

https://imgsrc.space/cat
https://imgsrc.space/architecture
https://imgsrc.space/cute dog

Resizing images

Imgsrc.space can also resize the images for you. To enter your desired dimensions put an "?" at the end of the search term and then your enter your desired height and width. Here "h" stands for height and w stands for width. They must be separated by an &

https://imgsrc.space/cat?h=400&w=400
https://imgsrc.space/architecture?h=700&w=600

AutoResizing images

If you only provide a single dimension parameter (i.e only height or width) Imgsrc.Space would automatically resize the other parameters accordingly

https://imgsrc.space/paris?h=500
https://imgsrc.space/ocean?w=600


Getting a specific Video

To get a specific image just enter the search word in the image source after a dot and a space followed by an -v

https://imgsrc.space/cat-v
https://imgsrc.space/ocean-v
https://imgsrc.space/river-v

Common errors and trouble shooting

Images are not loading?

Images are not resizing?

Videos are not loading?

Note: Max dimensions for resizing are 1920 for width and 1080 for height. If you increase the h and w more than that it will return the original image, without resizing it.
Error codes

Imgsrc.Space has image error codes. "Barfi" and "Pluto" are the dogs who have the important job to tell you that something is wrong. If you see them then most of the time you should try searching for other terms. Or check if your syntax is correct. If problem persists try contacting us or check our status page. "Barfi" handles image errors while "Pluto" handles video errors

Left is Burfi (Saying sorry for an image errors with a flower), Right is pluto (Handling video errors with swag)
Contact

If you need any help please contact us - Email