You can do a lot of amazing things with the Unsplash API! Whether you're looking to build a photo-editing app, a wallpaper app, or a photo-sharing website, you can use the Unsplash API to get access to over a million free, high resolution photos. Here are some of the amazing things you can build with the Unsplash API:
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
unsplash: {
type: "app",
app: "unsplash",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://api.unsplash.com/me`,
headers: {
Authorization: `Bearer ${this.unsplash.$auth.oauth_access_token}`,
},
})
},
})
Unsplash uses OAuth authentication. When you connect your Unsplash account, Pipedream will open a popup window where you can sign into Unsplash and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Unsplash API.
Pipedream requests the following authorization scopes when you connect your account:
public
read_user
write_user
read_photos
write_photos
write_likes
write_followers
read_collections
write_collections
GET
https://unsplash.com/oauth/authorize
?
client_id={{custom_fields.access_key}}
&
redirect_uri={{oauth.redirect_uri}}
&
state={{oauth.state}}
&
response_type=code
&
scope={{oauth.space_separated_scopes}}
POST
https://unsplash.com/oauth/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{custom_fields.access_key}}
&
client_secret={{custom_fields.secret_key}}
&
redirect_uri={{oauth.redirect_uri}}
&
grant_type=authorization_code
&
code={{oauth.code}}