DEV Community

Discussion on: Detecting DEV peak hours via API (bash study)

Collapse
 
rodiongork profile image
Rodion Gorkovenko • Edited

Hi, I think yes, though it is not documented. Source code contains per_page parameter which governs amount of articles in the response.

For example:

dev.to/api/articles/?per_page=3

However, probably it is not good idea to load very large responses (don't know if there is limit). Rather use page parameter to send several requests to different pages. E.g.

dev.to/api/articles/?page=333

Collapse
 
mzaini30 profile image
Zen • Edited

Then, how to get 10 posts from Dev randomly? 😂

Oh. I got idea:

  • Get number of total posts (eg: 1000)
  • Get 10 number randomly from 0 to 1000
Thread Thread
 
rodiongork profile image
Rodion Gorkovenko

Yep. Good idea! Just exactly what is described in this article above :)

Thread Thread
 
mzaini30 profile image
Zen

😂 thanks