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?
- Make sure that you are strictly following the syntax. Your image source must start with an "dot" and be followed by an "space" character. After that you can enter your search term
- Try using some other search words, there is an possibility that a there are no search results for a given term.
Images are not resizing?
- Make sure that use the "?" question mark symbol at the end of the search term. Use h for setting the height and w for setting the width. Make sure that there is an & symbol between them.
Videos are not loading?
- Make sure that you are strictly following the syntax. Your video source must start with an "dot" and be followed by an "space" character. After that you can enter your search term, followed by an "-v"
- Try using some other search words, there is an possibility that a there are no search results for a given term.
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?
- Try using some other search words, there is an possibility that a there are no search results for a given term.
Images are not resizing?
- Make sure that use the "?" question mark symbol at the end of the search term. Use h for setting the height and w for setting the width. Make sure that there is an & symbol between them.
Videos are not loading?
- Try using some other search words, there is an possibility that a there are no search results for a given term.
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
Contact
If you need any help please contact us - Email