For a long time there was an item on the roadmap that I finally got the chance to release - a way to search for and insert royalty-free images from an external service. All without leaving the MainCross editing environment.
Enter Unsplash
We've come a long way from the times when finding an image to use on a post or some content was fraught with licensing issues. First Pixabay and then Unsplash have really changed this bit of the world, for better.
As Unsplash says:
Beautiful, free images gifted by the worldβs most generous community of photographers. Better than any royalty free or stock photos.
And their license terms are splendid:
Unsplash photos are made to be used freely. Our license reflects that.
- All photos can be downloaded and used for free
- Commercial and non-commercial purposes
- No permission needed (though attribution is appreciated!)
So an obvious choice for this was Unsplash as the source of images.
API access
Now having such a service which allows royalty free licensing of images is one part of the story. Its great, but its still clunky to operate - one has to open the service, search, then download the image and finally upload into the editor one is using.
So the obvious requirement is to have the photo service integrated into the MainCross system.
The folks over at Unsplash run a wonderfully generous service - allowing anyone to search and pull images from their service via their APIs. And the icing on the cake is that they actually require images to be hot linked, which means that one does not need to go through the headache of uploading a photo into one's own storage system - with many obvious advantages.
Seamless integration
So without further ado, here's our rather sweet search-and-insert image facility, currently available for the Long Form Editor (and its elder brother, the Long Form+ Editor).
One can search and insert an image as the featured image of the story, or within the body.
For instance, here's me searching and inserting an image right here as I write this article:
And here's the inserted image complete with automatic attribution.
The featured image on this post is also from Unsplash.
Isn't that just so easy peasy, lemon squeezy?
Technical details
In order to use their API service in production, Unsplash has 4 conditions which I've summarized as follows:
- Hotlinking
- Triggering download end point
- Image and service attribution
- Keeping access and secret key confidential
These were not very difficult to meet and after completing the integration, we sent the request off to them with some screenshots showing exactly how we met their guidelines π .
Here are some screenshots for the nerd inside each of us:
I thought it would take a long time for someone to look into and approve (or reject!) our request. But someone from their partnership team approved MainCross in a day. Well, my respect for the Unsplash team has grown even more.