Search code examples
pythonpython-3.xreddit

How to set limit of number of entries while requesting a json from subreddit


async with aiohttp.ClientSession() as cs:
    async with cs.get('https://www.reddit.com/r/memes/hot.json') as r:
        res = await r.json()

This is my code to get json from reddit but it only gets 25 entries. How to get more than that?


Solution

  • Adding ?limit=somevalue should give you more results.

    https://www.reddit.com/r/memes/hot.json?limit=100