Donmai

API request and search box submit result are different.

Posted under Bugs & Features

I am trying to make json API requests to download the equivalent of the popular page for date:2024-05-09 and order:score which if used on the site returns the popular page results exactly, but when calling the api for it like this :
"https://$username:$",api.key,"@danbooru.donmai.us/posts.json?tags=order%3Ascore%20date%3A2024-05-09&z=5&limit=200"
it returns similar collection of posts to the popular page but not quite some of them are something else entirely, like the very first result. I am guessing I am fucking somthing up like the timezone or the z=5 variable.
What does "z=5" do?

Updated

The z parameter is for statistics and has no influence on returned results. You shouldn't include it in API calls.

It probably doesn’t make a difference, but the site always separates tags in the query string with +, not %20.

@RaisingK I have the same issue it returns posts that are off timezone , browser returns +0300 and the api request in my script returns -0400, and I cant see any significant request header that the browser sends so that it receives the correct timezone, do I have to use username and api key with you URL?

evazion said:

The time zone depends on your account settings. If your script is using a different account than your normal account, then they may have different time zones. Check https://danbooru.donmai.us/profile.json to see if your script is logging in properly and using the expected time zone.

Thanks, this : "https://danbooru.donmai.us/explore/posts/popular.json?date=2024-05-10&scale=day&limit=200&login=theo1996&api_key=",api.key " worked with GET() in R. Now it returns the proper timezone.
curl "https://$username:$api_key@danbooru.donmai.us/profile.json" <- this one didnt work though, dont know why. Kept returning false.

Updated

1