Search and insert images from an external service
productArticle05 Jan, 2022
Last edited: 02 Jan, 2024, 6:20 PM

Search and insert images from an external service

Everyone loves a great image to accompany their stories and articles, so today we have a sweet new method to find and automatically use images from Unsplash

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:

Comprehensive search window for finding images from unsplash

And here's the inserted image complete with automatic attribution.

This image has been inserted here, from Unsplash, found via the search above

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:

  1. Hotlinking
  2. Triggering download end point
  3. Image and service attribution
  4. 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:

Screenshot showing how we met guideline 1
Screenshot showing how we met guideline 3

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.

Want to be informed when this author publishes the next article?

Save, embed, share, report
0comments

Explore more channels?Show all

product
product release notes
Stories & use-cases
Community talk
Operator support
MainCross

More from this channel

Select between trending, latest and important content.