
Unsplash Has a Free API — Search and Download HD Photos Programmatically
Need free stock photos for your app? Unsplash has 4 million+ high-resolution photos, and their API lets you search and download them programmatically. No watermarks. Free for commercial use. Here is how. Get Your API Key (2 minutes) Go to unsplash.com/developers Create a new application Copy your Access Key Free tier: 50 requests/hour (enough for most use cases). Search Photos const ACCESS_KEY = ' your_access_key ' ; async function searchPhotos ( query , perPage = 10 ) { const response = await fetch ( `https://api.unsplash.com/search/photos?query= ${ query } &per_page= ${ perPage } ` , { headers : { Authorization : `Client-ID ${ ACCESS_KEY } ` } } ); const data = await response . json (); return data . results . map ( photo => ({ id : photo . id , description : photo . description || photo . alt_description , url_small : photo . urls . small , url_regular : photo . urls . regular , url_full : photo . urls . full , photographer : photo . user . name , download_link : photo . links . dow
Continue reading on Dev.to Webdev
Opens in a new tab




