Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
160
rated 0 times [  162] [ 2]  / answers: 1 / hits: 15286  / 11 Years ago, thu, january 30, 2014, 12:00:00

I'm trying to implement a search using reddit's api, but am not having much luck:



http://www.reddit.com/search.json?q=ferrari?jsonp=?


It's returning some json formatted text but no results.. If I search cars, it returns 2 results, and the rest of my code won't recognize the objects. (Plus, I know there's more than 2 results for cars). Any idea on how to modify the URL?


More From » json

 Answers
27

Your URL looks wrong. I think you used a question mark instead of an amp to separate request variables.



I tried using http://www.reddit.com/search.json?q=ferrari and I got a lot of results in JSON format.



This will allow you to do the most basic search for reddit posts.



You can add other parameters, described on the reddit API page : http://www.reddit.com/dev/api#GET_search. You can also limit your search to one subreddit.



For example, to get the same results, sort by newest : http://www.reddit.com/search.json?q=ferrari&sort=new


[#72834] Wednesday, January 29, 2014, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
blaisep

Total Points: 748
Total Questions: 95
Total Answers: 108

Location: Federated States of Micronesia
Member since Sun, May 16, 2021
3 Years ago
blaisep questions
Wed, Dec 16, 20, 00:00, 4 Years ago
Sun, Aug 16, 20, 00:00, 4 Years ago
Tue, Nov 12, 19, 00:00, 5 Years ago
Mon, Nov 11, 19, 00:00, 5 Years ago
;