API: Search

Return a list of articles matching the supplied text.

http://churnalism.com/api/search/

This API must be invoked via a POST. GETs will be ignored. The amount of text typically searched for is large enough that encoding it in the url for a GET becomes a little unwieldly.

The results are returned as json.

Parameters:

text
The text to search for (eg the body of a press release). This must contain at least 15 characters.

Returns:

success
boolean - false if an error occured, in which case error will be the only other field returned.
error
Information about what went wrong. Only included if success is false.
articles
list of articles matching the submitted text. Each entry has the following fields:
source
url of original article
journalisted
url on journalisted.com page with additional information about the article
score
Number indicating the count of 15 character windows which match between the input text and the article
query-time
Time taken to process query, in seconds

example (in python)

import urllib   # for urlencode 
import urllib2 
      
url = 'http://churnalism.com/api/search/' 
values = {'text' : 'Grapefruit are awesome'} 
      
data = urllib.urlencode(values) 
req = urllib2.Request(url, data) 
response = urllib2.urlopen(req) 
json = response.read() 
print json 
         

Try it out