@sl-code-lords/image-library
v1.0.0
Published
image-library [unsplash || pixabay ] - API
Downloads
13,867
Readme
📝 Table of Contents
🧐 About
API - Unsplash API - Pixabay
🏁 Getting Started
This project was created using official API (Unsplash , Pixabay)
Installing
yarn add @sl-code-lords/image-library
or
npm i @sl-code-lords/image-library
🎈 Usage
const {unsplash, pixabay} = require("@sl-code-lords/image-library")
Unsplash - API
var result = await unsplash.search({"query": "nature", page: 1}) // page => Pagination
//result
{
status: true,
code_creator: { name: 'Sisula Welgamage', github: '@sisula' },
base_url: 'https://unsplash.com/',
total_results: 10016,
total_pages: 334,
result: [
'https://unsplash.com/photos/ugnrXk1129g/download?ixid=M3w0ODA5NTZ8MHwxfHNlYXJjaHwxMjF8fG5hdHVyZXxlbnwwfHx8fDE2OTA1Mjg1ODV8MA',
'https://unsplash.com/photos/v4bkVOl1sTI/download?ixid=M3w0ODA5NTZ8MHwxfHNlYXJjaHwxMjJ8fG5hdHVyZXxlbnwwfHx8fDE2OTA1Mjg1ODV8MA',
'https://unsplash.com/photos/bm15OYOm-Gc/download?ixid=M3w0ODA5NTZ8MHwxfHNlYXJjaHwxMjN8fG5hdHVyZXxlbnwwfHx8fDE2OTA1Mjg1ODV8MA',
'https://unsplash.com/photos/LNYdZutqsi0/download?ixid=M3w0ODA5NTZ8MHwxfHNlYXJjaHwxMjR8fG5hdHVyZXxlbnwwfHx8fDE2OTA1Mjg1ODV8MA',
... 25 more items
]
Pixabay - API
var result = await pixabay.search({"query": "nature", page: 3}) // page => Pagination
//result
{
status: true,
code_creator: { name: 'Sisula Welgamage', github: '@sisula' },
base_url: 'https://pixabay.com/',
total_results: 880522,
total_pages: undefined,
result: [
'https://pixabay.com/get/gf8180d0a3d9ad4ca6861a3ded76a1a74d4df540e1f10e3ee8a8440924db766d73e138b885523e3340eb883ee3006fe127c59398c5641ae507ce4bf160d2b93d4_1280.jpg',
'https://pixabay.com/get/g51a4bfb189347267f7576a99333e4b478ba0af5b95e069cde3fa5bbe575cc0c8d582a674b920d6156a1f5745bd7af596758c8a0b517ba7db08b26201ffb9355c_1280.jpg',
... 27 more items
]
✍️ Authors
- @sisula welgamage - project author
See also the list of contributors who participated in this project.