It may be interesting, when there are more people reading DEV - for example, perfect timing is important for those who is obsessed with idea to get...
For further actions, you may consider blocking this person and/or reporting abuse
Wow. I motivated to build app that get random posts from Dev.
I see in docs.dev.to/api/#operation/getArti..., JSON only get 30 posts. Can I reach more than 30?
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
Then, how to get 10 posts from Dev randomly? 😂
Oh. I got idea:
Yep. Good idea! Just exactly what is described in this article above :)
😂 thanks
As I couldn't use:
as
-P
doesn't work in macOS I replaced it with the utility I use to pretty print JSON,jq
:or even better, as we don't need the entire page:
this doesn't work in macOS either:
I replaced it with:
or even better:
jq is truly awesome :D stedolan.github.io/jq/manual/