Sorry if this is a repost. This was very frustrating for me. If you do
not supply the 'limit' switch to a query and allow the default
response, the payload delivered can actually break php's
For example, I tried to request
and json_decode chokes and dies on that, always returning malformed
If you change the request to
and so on, the payload parses fine. The limit switch should be on the
search FAQ. Even devs will look there first since it's the first thing
google gives up. I thought it was unlikely that reddit was returning
bad JSON and sure enough, it isn't.
I hope this helps someone.