Topic: API: Comment search by date not supported?

Posted under e621 Tools and Applications

tl,dr: Should searching comments by date via the e621 API work?

I am trying to search comments on e621 by date. I can get it to work interactively, but not via the API. I'm not sure if my syntax is wrong or if e621 just doesn't support this particular search via the API.

For instance, if I want to see all the comments created on New Year's Day 2023, this search works just fine interactively:

https://e621.net/comments?group_by=comment&search[created_at]=2023-01-02T00:00:00Z

However, trying to do the same search through the API gives me the "403 Access Denied - Oh no!" page*:

https://e621.net/comments.json?group_by=comment&search[created_at]=2023-01-02T00:00:00Z

I even tried it through the API with a more "proper" ISO-8601 timestamp, but that gets me the same 403 page:

https://e621.net/comments.json?group_by=comment&search[created_at]=2023-01-02T00:00:00.000-00:00

(* The one that's black and white, mentions Grabber near the top, and lists four reasons why the query might not have worked.)

I get the 403 page whether I try it from an interactive browser, or from a program that has a custom User-Agent that I believe meets e621's requirements.

e621's official API documentation doesn't mention searching comments at all.

Donovan_DMC's unofficial API documentation describes searching for comments, but doesn't specifically mention the created_at option to search. On another page , it claims that "most search endpoints" accept the search[created_at] syntax.

Danbooru's API documentation seems to say that this search should work, although I realize e621 isn't vanilla Danbooru anymore.

Thanks!

I don't see any reason why it would be intentional for this to work in the UI but not with the API, the site's code clearly permits the parameter it and it works just fine on my own local instance.

You might want to post this in topic #25734.

faucet said:
I don't see any reason why it would be intentional for this to work in the UI but not with the API, the site's code clearly permits the parameter it and it works just fine on my own local instance.

I just had a flashback to this post , where I found an older post that used a /comments?format=json&... URL, instead of the /comments.json?... URL.

So I tried this:

https://e621.net/comments?format=json&group_by=comment&search[created_at]=2023-01-02T00:00:00Z

and it worked just fine. I got a JSON array of 75 comments, like I would expect. I can even append things like &limit=10 to that URL and they work, too.

The /comments.json URL does work for some things. This one, from the thread linked above, works just fine:

https://e621.net/comments.json?group_by=comment&search[post_id]=3000000

This sounds like a misconfiguration of some server between e621 and the internet, where this is somehow getting caught up as legacy api usage. I can't really speak to exactly why, but mentioning it in topic #25734 would probably get the ball rolling on getting it fixed.

  • 1