unsplash / unsplash-js

🤖 Official JavaScript wrapper for the Unsplash API
https://www.npmjs.com/package/unsplash-js
MIT License
2.13k stars 156 forks source link

Adding per_page & page doesnt give proper result #128

Closed schroef closed 4 years ago

schroef commented 4 years ago

Steps to Reproduce

Im looking into this Extension for illustrator which uses the API to find an image based on a query. I noticed the API was updated and /photos/search/ was switched. However the attributes per_page and page doesn't seem to work. I cant find the proper order when using client_id in a path string in the documentation neither. All show single examples.

But using this path string https://api.unsplash.com/search/photos/?client_id=CLIENT_ID&query=kitten&per_page=1&page=1 does not return a single image.

-

Observed Behaviour

Image or video please. Screen Shot 2020-06-18 at 9 52 37 PM

Expected Behaviour

-

Technical Notes

lukechesser commented 4 years ago

@schroef hm I can't reproduce:

curl --request GET \
  --url 'https://api.unsplash.com/search/photos?query=puppy&per_page=1&page=1&=&client_id=ACCESS_KEY' \
  --header 'content-type: application/json'
{
  "total": 3280,
  "total_pages": 3280,
  "results": [
    {
      "id": "TzjMd7i5WQI", ... 
    }
  ]
}
schroef commented 3 years ago

sorry for the late response!

I see you have the query formatted differently where client_id is at the end. Ill try that