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.
per_page
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.
page
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
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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