We'll a single set of data using a serverless function and multiple APIs. We already have our API for pulling the corgi's data, the next step is getting the images from Unsplash using the Unsplash API.
To access the Unsplash API, create an account. Once your account has been registered for the API, go to your apps. Click “New Application”, and fill in the required details. To use the API you must abide by the terms and follow the API guidelines.
The API is available at https://api.unsplash.com/. Responses are sent as JSON.
The collection we'll be loading is available at api.unsplash.com/collections/48405776/photos You'll need your own API key!
Serverless functions help us comply with the terms and API guidelines by protecting API keys and making secure calls to 3rd Party APIs.
In this video, one of the benefits of serverless functions is they protect private data like env keys because serverless functions run in node and are never shipped to the browser. Couldn't you just create a .env and setup env variables on a site like netlify without a serverless function as well, unless I do not fully understand how env files traditionally work I do not see that as a benefit to serverless?