4chan / 4chan-API

Documentation for 4chan's read-only JSON API.
http://www.4chan.org/
1.03k stars 73 forks source link

What's the endpoint for getting "Popular Threads"? #64

Closed catamphetamine closed 5 years ago

catamphetamine commented 5 years ago

On the main 4chan page there's the "Popular Threads" section. What's the data source API endpoint for that? E.g. getting a list of threads with their "scores" or "ratings" or "speed" (posts per second/minute). There seems to be none in the docs.

catamphetamine commented 5 years ago

Looked at "Chanu" source codes: it seems to parse 4chan.org main page HTML to get the list of "Popular threads" instead of using an API endpoint. https://github.com/grzegorznittner/chanu/blob/8a65b87847ff1aea0366cf3c1e03d70edb94e36c/app/src/main/java/com/chanapps/four/service/FetchPopularThreadsService.java#L277-L286

What about 4stats.io then? Do you use an API endpoint or do they also just parse HTML?

image

catamphetamine commented 5 years ago

I contacted 4stats.io admins and they replied with a detailed explanation. I described their approach in this document: https://github.com/catamphetamine/captchan/blob/master/docs/4chan.org.md#get-popular-threads-list

The reason why I asked is because we have such kind of an API on Russian "4chan": https://2ch.hk/b/threads.json That's why I thought that 4chan.org had a similar API endpoint.

desuwa commented 5 years ago

There's no endpoint for that. You'll have to calculate the score yourself. Something like what you posted above or just calculate some kind of "recent activity" score for each thread based on the amount of new replies in the past X minutes.