- Search Requests
- Search Response Formats
- Search Response Vocabulary
- Examples
1. Search Requests
Search requests are made by performing an HTTP GET request for a URL of the form:
http://app.oneriot.com/search?version=1.0&appId=<yourAppId>&q=<query>[&<param>=<value>...]
where <yourAppId> is replaced with your assigned application identifier, <query> is replaced with your
%-encoded query string, and [&<param>=<value>...] is replaced with zero or more of the optional parameters described below, the values of which are also %-encoded as usual for URL-encoded form data.
Required parameters
version
the version of the API to which the request conforms, and to which the response must also conform
1.0 is the only value currently recognized or allowed
appId
your assigned application identifier
q
the search query for which you want results
Optional parameters
type
the type of content to search for: ALL or VIDEO
default value: ALL
order
criterion by which to order results: PULSE or REALTIME
default value: PULSE
limit
maximum number of results to return
default value: 10
page
the 1-based number of the page of results to return, where the number of results on each page is determined by the value of the limit parameter
default value: 1
format
the format of the response: JSONP or XML
default value: JSONP
2. Search Response Formats
Though the vocabulary used in search responses is consistent across formats, the specific syntax differs. The following sections describe those specifics based upon the value of the format request parameter.
Each format description includes all possible fields; see the field descriptions for details about when fields are included or omitted, as well as what each field means.
JSONP
The OneRiot API supports a variant of JSONP that uses the fixed callback name com_oneriot_search_results. The callback parameter usually provided in JSONP requests is allowed but ignored. The results object contains all of the data needed to link the results object to the corresponding request: the query, type, order, page number, etc.
com_oneriot_search_results(
{
"version": "1.0",
"query": "[query]",
"type": "[type]",
"order": "[order]",
"time": [seconds since epoch],
"maxAge": [seconds],
"totalResults": [estimated total number of results available],
"pageNumber": [page number],
"pageSize": [page size],
"resultList":
[
{
"type": "[result type]",
"displayUrl": "[URL to display to user]",
"redirectUrl": "[URL that must be used for navigation]",
"title": "[title]",
"snippet": "[snippet]",
"thumbnail":
{
"url": "[thumbnail image URL]",
"width": [thumbnail width in pixels],
"height": [thumbnail height in pixels]
},
"firstShare":
{
"user":
{
"service": "[service identifier]",
"id": "[user identifier]",
"image":
{
"url": "[user image URL]",
"width": [user image width in pixels],
"height": [user image height in pixels]
}
},
"time": [seconds since epoch],
"comment": "[comment]"
},
"sharesList":
[
{
"service": "[service identifier]",
"total": [number of times this result shared on this service]
},
.
.
.
]
},
.
.
.
]
}
)
XML
<?xml version="1.0" encoding="UTF-8"?>
<search-results xmlns="http://xmlns.oneriot.com/api/1.0/">
<version>1.0</version>
<query>[query]</query>
<type>[type]</type>
<order>[order]</order>
<time>[seconds since epoch]</time>
<max-age>[seconds]</max-age>
<total-results>[estimated total number of results available]</total-results>
<page-number>[page number]</page-number>
<page-size>[page size]</page-size>
<result-list>
<result>
<type>[result type]</type>
<display-url>[URL to display to user]</display-url>
<redirect-url>[URL that must be used for navigation]</redirect-url>
<title>[title]</title>
<snippet>[snippet]</snippet>
<thumbnail>
<url>[thumbnail image URL]</url>
<width>[thumbnail width in pixels]</width>
<height>[thumbnail height in pixels]</height>
</thumbnail>
<media-duration>[media duration in seconds]</media-duration>
<first-share>
<user>
<service>[service identifier]</service>
<id>[user identifier]</id>
<image>
<url>[user image URL]</url>
<width>[user image width in pixels]</width>
<height>[user image height in pixels]</height>
</image>
</user>
<time>[seconds since epoch]</time>
<comment>[comment]</comment>
</first-share>
<shares-list>
<shares>
<service>[service identifier]</service>
<total>[number of times this result shared on this service]</total>
</shares>
.
.
.
</shares-list>
</result>
.
.
.
</result-list>
</search-results>
3. Search Response Vocabulary
Search responses contain the same information whether formatted as JSONP or XML, and hence use the same vocabulary. The following field definitions follow the format:
jsonName [xml-name]
definition
where [xml-name] is omitted if it is identical to
jsonName.
Search Results
Each response contains a set of information about the set of results as a whole, including at least:
version
the version of the API to which the response conforms
query
the query provided in the request
time
the time at which the result set was generated, in seconds since the epoch (midnight, January 1, 1970 UTC)
maxAge [max-age]
the number of seconds for which the result should be considered valid
totalResults [total-results]
the estimated total number of results available for this query (can be used to estimate the number of pages available)
The response may also include:
type
the type of content requested: ALL or VIDEO
default value: ALL
order
the criterion by which results are ordered: PULSE or REALTIME
default value: PULSE
pageNumber [page-number]
the 1-based number of the page of results presented by the response, calculated with respect to pageSize
default value: 1
pageSize [page-size]
the number of results per page, determined by the value of the limit parameter of the request
may be omitted only if pageNumber is 1
Result
In addition to the result-set information, each response contains a list of zero or more results, ordered from most relevant to least relevant with respect to the requested order, each of which contains at least:
displayUrl [display-url]
URL of the result, as it should be displayed to the user
redirectUrl [redirect-url]
URL that must be used to navigate to the result, e.g. in response to the user clicking on the result
and may also contain zero or more of:
type
type of the result: WEB_PAGE or VIDEO
default value: WEB_PAGE
title
title of the result, with query terms highlighted by <b>…</b> and with special characters encoded as character entity references so that it can be directly embedded in HTML content or used to set an HTML element’s innerHTML.
snippet
representative portion of text from the result, with query terms highlighted by <b>…</b> and with special characters encoded as character entity references so that it can be directly embedded in HTML content or used to set an HTML element’s innerHTML.
thumbnail
representative image of the result
this field contains subfields: see Image below
mediaDuration [media-duration]
the duration in seconds of the media (video) to which the result refers
firstShare [first-share]
information about the first known share of the result
this field contains subfields: see First Share below
sharesList [shares-list]
a set of collections of information about the shares of the result on a particular service
the members of this field contain subfields: see Shares below
First Share
If present, the firstShare result field contains at least:
user
information about the user who first shared the result
this field contains subfields: see User below
time
the time at which the result was first shared, in seconds since the epoch (midnight, January 1, 1970 UTC)
and may also contain:
comment
a comment made by the user as part of the share
Shares
Each member of the set of shares provided with a result contains:
service
the service to which the shares member refers
an identifier from the set of published service identifiers (see Service below)
total
the total number of times the result was observed to be shared by users of service.
Service
The following identifiers identify those services about which OneRiot currently publishes sharing information. This is not a complete list of the services and sources of information OneRiot uses to discover and rank search results.
DIGG
Developers should expect this list to expand in the future without notice, and should therefore handle new values gracefully.
User
These subfields are used to identify and describe a user. Any field that refers to a user will contain at least:
service
the service to which the user belongs
must be an identifier from the set of published service identifiers: see Service above
id
a string that uniquely identifies the user with respect to service
and may also contain:
image
an image that represents the user on the service
this field contains subfields: see Image below
Image
These subfields are used to identify and describe an image. Any field that refers to an image will contain at least:
url
the URL from which the image data can be obtained
and may also contain:
width
the width of the image in pixels
height
the height of the image in pixels
4. Examples
JSONP example
Request:
http://app.oneriot.com/search?version=1.0&appId=example1&q=obama
Response:
com_oneriot_search_results(
{
"version": "1.0",
"query": "obama",
"time": 1247099142,
"maxAge": 4,
"totalResults": 104,
"resultList":
[
{
"displayUrl": "http://www.chicagotribune.com/news/chi-ap-mi-obama-collins%2C0%2C7750629.story",
"redirectUrl": "http://app.dev.oneriot.com/?target=http%3A%2F%2Fwww.chicagotribune.com%2Fnews%2Fchi-ap-mi-obama-collins%252C0%252C7750629.story&oid=d95d7cbbc5adb0f0bab744bca0a0f997&queryId=8a54c28d-3864-4275-b339-af3a005d9430",
"title": "Obama names ex-UM geneticist to head health agency -- chicagotribune.com",
"snippet": "President Barack <b>Obama<\/b> says he's nominating ex- University of Michigan genetics pioneer Francis S. Collins as director of the National Institutes of...",
"firstShare":
{
"user":
{
"service": "TWITTER",
"id": "Lily244",
"image":
{
"url": "http://s3.amazonaws.com/twitter_production/profile_images/67650814/Nzou_Family_Edited_normal.jpg"
}
},
"time": 1247088234,
"comment": "Obama names ex-UM geneticist to head health agency: ... Obama praised Collins as "one of the top scientists.. http://bit.ly/E92Vf"
},
"sharesList":
[
{
"service": "TWITTER",
"total": 5
}
]
},
{
"displayUrl": "http://hotair.com/archives/2009/07/08/confidence-in-obama-economy-still-dropping/",
"redirectUrl": "http://app.dev.oneriot.com/?target=http%3A%2F%2Fhotair.com%2Farchives%2F2009%2F07%2F08%2Fconfidence-in-obama-economy-still-dropping%2F&oid=a733944672a9f1a413f0b630a21b25fe&queryId=8a54c28d-3864-4275-b339-af3a005d9430",
"title": "Hot Air » Blog Archive » Confidence in Obama, economy still dropping",
"snippet": "Yesterday , I noted that the Rasmussen poll with a Barack <b>Obama<\/b> “passion index” of -3 still had yet to fully poll after last week’s...",
"firstShare":
{
"user":
{
"service": "TWITTER",
"id": "MartinaShelton",
"image":
{
"url": "http://s3.amazonaws.com/twitter_production/profile_images/218633317/MartinaShelton_normal.jpg"
}
},
"time": 1247091486,
"comment": "Hot Air » Blog Archive » Confidence in Obama, economy still dropping http://bit.ly/rO30U"
},
"sharesList":
[
{
"service": "TWITTER",
"total": 3
}
]
},
{
"displayUrl": "http://www.wnd.com/index.php?fa=PAGE.view&pageid=103306",
"redirectUrl": "http://app.dev.oneriot.com/?target=http%3A%2F%2Fwww.wnd.com%2Findex.php%3Ffa%3DPAGE.view%26pageid%3D103306&oid=9b894e403e7ea08f584088a06f5e53cf&queryId=8a54c28d-3864-4275-b339-af3a005d9430",
"title": "Obama birth mystery: More than 1 hospital",
"snippet": "The mystery surrounding the precise birthplace of Barack <b>Obama<\/b> is deepening as the myth-busting website Snopes.com , along with several news agencies...",
"firstShare":
{
"user":
{
"service": "DIGG",
"id": "24AheadDotCom"
},
"time": 1247079844
},
"sharesList":
[
{
"service": "DIGG",
"total": 9
},
{
"service": "TWITTER",
"total": 2
}
]
},
{
"displayUrl": "http://www.huffingtonpost.com/john-passacantando/greenpeace-to-add-obama-t_b_228017.html",
"redirectUrl": "http://app.dev.oneriot.com/?target=http%3A%2F%2Fwww.huffingtonpost.com%2Fjohn-passacantando%2Fgreenpeace-to-add-obama-t_b_228017.html&oid=2942af2345b175ade84da178803ccb79&queryId=8a54c28d-3864-4275-b339-af3a005d9430",
"title": "John Passacantando: Greenpeace to Add Obama to Mount Rushmore?",
"snippet": "This is Greenpeace's message to President <b>Obama<\/b> today while he meets at the G-8 summit, showing him the kind of historical moment he has in his...",
"thumbnail":
{
"url": "http://media.dev.oneriot.com/images_90x90/044/1CD787B2751DDDCF37B8401B5918C1AE.jpg"
},
"firstShare":
{
"user":
{
"service": "TWITTER",
"id": "GunterFromm",
"image":
{
"url": "http://s3.amazonaws.com/twitter_production/profile_images/142517692/Scannen0033_normal.jpg"
}
},
"time": 1247091214,
"comment": "John Passacantando: Greenpeace to Add Obama to Mount Rushmore? http://bit.ly/1FsZo"
},
"sharesList":
[
{
"service": "TWITTER",
"total": 2
}
]
},
{
"type": "VIDEO",
"displayUrl": "http://www.youtube.com/watch?v=fM_BV_DTxU8",
"redirectUrl": "http://app.dev.oneriot.com/?target=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DfM_BV_DTxU8&oid=8adbe02735f6e92283ec4d7b507d4c8f&queryId=8a54c28d-3864-4275-b339-af3a005d9430",
"title": "YouTube - G-8: Obama, Sarkozy Discuss Michael Jackson",
"snippet": "EUX.TV FIRST: Michael Jackson is the topic of a bout of laughter during an informal pre-dinner chat between US... <b>Obama,<\/b> French President Nicol...",
"thumbnail":
{
"url": "http://media.dev.oneriot.com/images_120x90/878/028EFEB07298C80B0F0F488E81654781.jpg"
},
"firstShare":
{
"user":
{
"service": "DIGG",
"id": "rayford"
},
"time": 1247087722
},
"sharesList":
[
{
"service": "DIGG",
"total": 3
}
]
},
{
"displayUrl": "http://money.cnn.com/2009/01/12/technology/stimulus_health_care/",
"redirectUrl": "http://app.dev.oneriot.com/?target=http%3A%2F%2Fmoney.cnn.com%2F2009%2F01%2F12%2Ftechnology%2Fstimulus_health_care%2F&oid=80d67678c691cc1f9fb72160d0ed1990&queryId=8a54c28d-3864-4275-b339-af3a005d9430",
"title": "Obama's health care challenge - Jan. 12, 2009",
"snippet": "President-elect Barack <b>Obama<\/b> has proposed a massive effort to modernize the nation's health care system by making all health records standardized and...",
"firstShare":
{
"user":
{
"service": "TWITTER",
"id": "Salesearch",
"image":
{
"url": "http://s3.amazonaws.com/twitter_production/profile_images/220786446/Matt_4_normal.JPG"
}
},
"time": 1247083004,
"comment": "President-elect wants to computerize the nation's health care records in five years. http://bit.ly/5BcVy"
},
"sharesList":
[
{
"service": "TWITTER",
"total": 1
}
]
},
{
"displayUrl": "http://hotair.com/archives/2009/07/08/obama-patronage-worse-than-thought/",
"redirectUrl": "http://app.dev.oneriot.com/?target=http%3A%2F%2Fhotair.com%2Farchives%2F2009%2F07%2F08%2Fobama-patronage-worse-than-thought%2F&oid=4e7af9692ad7a013c1533a3764504a41&queryId=8a54c28d-3864-4275-b339-af3a005d9430",
"title": "Hot Air » Blog Archive » Obama patronage worse than thought",
"snippet": "The only reason this makes news in the <b>Obama<\/b> administration was because of Barack Obama’s oft-repeated conceit that he would bring a new kind of...",
"firstShare":
{
"user":
{
"service": "DIGG",
"id": "Piper0072",
"image":
{
"url": "/users/Piper0072/l.png"
}
},
"time": 1247084379
},
"sharesList":
[
{
"service": "DIGG",
"total": 7
}
]
},
{
"displayUrl": "http://www.msnbc.msn.com/id/31806096/ns/politics-white_house/",
"redirectUrl": "http://app.dev.oneriot.com/?target=http%3A%2F%2Fwww.msnbc.msn.com%2Fid%2F31806096%2Fns%2Fpolitics-white_house%2F&oid=5589de1f8ad349e91b4a98703d93461e&queryId=8a54c28d-3864-4275-b339-af3a005d9430",
"title": "Obama tax pledge unrealistic - White House- msnbc.com",
"snippet": "President Barack <b>Obama<\/b> promised to fix health care and trim the federal budget deficit, all without raising taxes on anyone but the wealthiest...",
"firstShare":
{
"user":
{
"service": "DIGG",
"id": "apackofmonkeys"
},
"time": 1247092077
},
"sharesList":
[
{
"service": "DIGG",
"total": 2
}
]
},
{
"displayUrl": "http://lsminsurance.ca/life-insurance-canada/2009/07/health-insurance-a-challenge-for-obama",
"redirectUrl": "http://app.dev.oneriot.com/?target=http%3A%2F%2Flsminsurance.ca%2Flife-insurance-canada%2F2009%2F07%2Fhealth-insurance-a-challenge-for-obama&oid=2540d65a5aa9485c29aea22f7de3209f&queryId=8a54c28d-3864-4275-b339-af3a005d9430",
"title": "Health Insurance: A Challenge for Obama",
"snippet": "Remember the McCain and <b>Obama<\/b> health care plan battle? The main difference between the two plans was primarily the candidates' stand towards the...",
"firstShare":
{
"user":
{
"service": "DIGG",
"id": "jonclayton",
"image":
{
"url": "/users/jonclayton/l.png"
}
},
"time": 1247082641
},
"sharesList":
[
{
"service": "DIGG",
"total": 7
}
]
},
{
"type": "VIDEO",
"displayUrl": "http://www.youtube.com/watch?v=KX-G6mxLuWQ",
"redirectUrl": "http://app.dev.oneriot.com/?target=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DKX-G6mxLuWQ&oid=bd12931fc4b6663ddf304ca3a46f3bf0&queryId=8a54c28d-3864-4275-b339-af3a005d9430",
"title": "YouTube - Fox News Jokes About Killing Obama",
"snippet": "While commenting on Hillary's RFK gaffe, Liz Trotta on Fox News Channel first referred to Barack <b>Obama<\/b> as "Osama" and then laughed...",
"thumbnail":
{
"url": "http://media.dev.oneriot.com/images_120x90/074/0BCF5C771279F6E6022871FABF042F64.jpg"
},
"mediaDuration": 15000,
"firstShare":
{
"user":
{
"service": "TWITTER",
"id": "AnthonyJPorath",
"image":
{
"url": "http://s3.amazonaws.com/twitter_production/profile_images/300710156/070909_mileytable_normal.jpg"
}
},
"time": 1247094368,
"comment": "http://bit.ly/ryyPm\n Just found this. Another one of the MANY things I despise about Fox News. Lack of respect."
},
"sharesList":
[
{
"service": "TWITTER",
"total": 1
}
]
}
]
}
)
XML example
Request:
http://app.oneriot.com/search?version=1.0&appId=example1&q=obama&format=XML
Response:
<?xml version="1.0" encoding="UTF-8"?>
<search-results xmlns="http://xmlns.oneriot.com/api/1.0/">
<version>1.0</version>
<query>obama</query>
<time>1247099163</time>
<max-age>4</max-age>
<total-results>104</total-results>
<result-list>
<result>
<display-url>http://www.chicagotribune.com/news/chi-ap-mi-obama-collins%2C0%2C7750629.story</display-url>
<redirect-url>http://app.dev.oneriot.com/?target=http%3A%2F%2Fwww.chicagotribune.com%2Fnews%2Fchi-ap-mi-obama-collins%252C0%252C7750629.story&oid=d95d7cbbc5adb0f0bab744bca0a0f997&queryId=aed6ea66-98ec-483d-861e-49731ed35c8f</redirect-url>
<title>Obama names ex-UM geneticist to head health agency -- chicagotribune.com</title>
<snippet>President Barack <b>Obama</b> says he's nominating ex- University of Michigan genetics pioneer Francis S. Collins as director of the National Institutes of...</snippet>
<first-share>
<user>
<service>TWITTER</service>
<id>Lily244</id>
<image>
<url>http://s3.amazonaws.com/twitter_production/profile_images/67650814/Nzou_Family_Edited_normal.jpg</url>
</image>
</user>
<time>1247088234</time>
<comment>Obama names ex-UM geneticist to head health agency: ... Obama praised Collins as "one of the top scientists.. http://bit.ly/E92Vf</comment>
</first-share>
<shares-list>
<shares>
<service>TWITTER</service>
<total>5</total>
</shares>
</shares-list>
</result>
<result>
<display-url>http://hotair.com/archives/2009/07/08/confidence-in-obama-economy-still-dropping/</display-url>
<redirect-url>http://app.dev.oneriot.com/?target=http%3A%2F%2Fhotair.com%2Farchives%2F2009%2F07%2F08%2Fconfidence-in-obama-economy-still-dropping%2F&oid=a733944672a9f1a413f0b630a21b25fe&queryId=aed6ea66-98ec-483d-861e-49731ed35c8f</redirect-url>
<title>Hot Air » Blog Archive » Confidence in Obama, economy still dropping</title>
<snippet>Yesterday , I noted that the Rasmussen poll with a Barack <b>Obama</b> “passion index” of -3 still had yet to fully poll after last week’s...</snippet>
<first-share>
<user>
<service>TWITTER</service>
<id>MartinaShelton</id>
<image>
<url>http://s3.amazonaws.com/twitter_production/profile_images/218633317/MartinaShelton_normal.jpg</url>
</image>
</user>
<time>1247091486</time>
<comment>Hot Air » Blog Archive » Confidence in Obama, economy still dropping http://bit.ly/rO30U</comment>
</first-share>
<shares-list>
<shares>
<service>TWITTER</service>
<total>3</total>
</shares>
</shares-list>
</result>
<result>
<display-url>http://www.wnd.com/index.php?fa=PAGE.view&pageid=103306</display-url>
<redirect-url>http://app.dev.oneriot.com/?target=http%3A%2F%2Fwww.wnd.com%2Findex.php%3Ffa%3DPAGE.view%26pageid%3D103306&oid=9b894e403e7ea08f584088a06f5e53cf&queryId=aed6ea66-98ec-483d-861e-49731ed35c8f</redirect-url>
<title>Obama birth mystery: More than 1 hospital</title>
<snippet>The mystery surrounding the precise birthplace of Barack <b>Obama</b> is deepening as the myth-busting website Snopes.com , along with several news agencies...</snippet>
<first-share>
<user>
<service>DIGG</service>
<id>24AheadDotCom</id>
</user>
<time>1247079844</time>
</first-share>
<shares-list>
<shares>
<service>DIGG</service>
<total>9</total>
</shares>
<shares>
<service>TWITTER</service>
<total>2</total>
</shares>
</shares-list>
</result>
<result>
<display-url>http://www.huffingtonpost.com/john-passacantando/greenpeace-to-add-obama-t_b_228017.html</display-url>
<redirect-url>http://app.dev.oneriot.com/?target=http%3A%2F%2Fwww.huffingtonpost.com%2Fjohn-passacantando%2Fgreenpeace-to-add-obama-t_b_228017.html&oid=2942af2345b175ade84da178803ccb79&queryId=aed6ea66-98ec-483d-861e-49731ed35c8f</redirect-url>
<title>John Passacantando: Greenpeace to Add Obama to Mount Rushmore?</title>
<snippet>This is Greenpeace&#39;s message to President <b>Obama</b> today while he meets at the G-8 summit, showing him the kind of historical moment he has in his...</snippet>
<thumbnail>
<url>http://media.dev.oneriot.com/images_90x90/044/1CD787B2751DDDCF37B8401B5918C1AE.jpg</url>
</thumbnail>
<first-share>
<user>
<service>TWITTER</service>
<id>GunterFromm</id>
<image>
<url>http://s3.amazonaws.com/twitter_production/profile_images/142517692/Scannen0033_normal.jpg</url>
</image>
</user>
<time>1247091214</time>
<comment>John Passacantando: Greenpeace to Add Obama to Mount Rushmore? http://bit.ly/1FsZo</comment>
</first-share>
<shares-list>
<shares>
<service>TWITTER</service>
<total>2</total>
</shares>
</shares-list>
</result>
<result>
<type>VIDEO</type>
<display-url>http://www.youtube.com/watch?v=fM_BV_DTxU8</display-url>
<redirect-url>http://app.dev.oneriot.com/?target=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DfM_BV_DTxU8&oid=8adbe02735f6e92283ec4d7b507d4c8f&queryId=aed6ea66-98ec-483d-861e-49731ed35c8f</redirect-url>
<title>YouTube - G-8: Obama, Sarkozy Discuss Michael Jackson</title>
<snippet>EUX.TV FIRST: Michael Jackson is the topic of a bout of laughter during an informal pre-dinner chat between US... <b>Obama,</b> French President Nicol...</snippet>
<thumbnail>
<url>http://media.dev.oneriot.com/images_120x90/878/028EFEB07298C80B0F0F488E81654781.jpg</url>
</thumbnail>
<first-share>
<user>
<service>DIGG</service>
<id>rayford</id>
</user>
<time>1247087722</time>
</first-share>
<shares-list>
<shares>
<service>DIGG</service>
<total>3</total>
</shares>
</shares-list>
</result>
<result>
<display-url>http://money.cnn.com/2009/01/12/technology/stimulus_health_care/</display-url>
<redirect-url>http://app.dev.oneriot.com/?target=http%3A%2F%2Fmoney.cnn.com%2F2009%2F01%2F12%2Ftechnology%2Fstimulus_health_care%2F&oid=80d67678c691cc1f9fb72160d0ed1990&queryId=aed6ea66-98ec-483d-861e-49731ed35c8f</redirect-url>
<title>Obama's health care challenge - Jan. 12, 2009</title>
<snippet>President-elect Barack <b>Obama</b> has proposed a massive effort to modernize the nation's health care system by making all health records standardized and...</snippet>
<first-share>
<user>
<service>TWITTER</service>
<id>Salesearch</id>
<image>
<url>http://s3.amazonaws.com/twitter_production/profile_images/220786446/Matt_4_normal.JPG</url>
</image>
</user>
<time>1247083004</time>
<comment>President-elect wants to computerize the nation's health care records in five years. http://bit.ly/5BcVy</comment>
</first-share>
<shares-list>
<shares>
<service>TWITTER</service>
<total>1</total>
</shares>
</shares-list>
</result>
<result>
<display-url>http://hotair.com/archives/2009/07/08/obama-patronage-worse-than-thought/</display-url>
<redirect-url>http://app.dev.oneriot.com/?target=http%3A%2F%2Fhotair.com%2Farchives%2F2009%2F07%2F08%2Fobama-patronage-worse-than-thought%2F&oid=4e7af9692ad7a013c1533a3764504a41&queryId=aed6ea66-98ec-483d-861e-49731ed35c8f</redirect-url>
<title>Hot Air » Blog Archive » Obama patronage worse than thought</title>
<snippet>The only reason this makes news in the <b>Obama</b> administration was because of Barack Obama’s oft-repeated conceit that he would bring a new kind of...</snippet>
<first-share>
<user>
<service>DIGG</service>
<id>Piper0072</id>
<image>
<url>/users/Piper0072/l.png</url>
</image>
</user>
<time>1247084379</time>
</first-share>
<shares-list>
<shares>
<service>DIGG</service>
<total>7</total>
</shares>
</shares-list>
</result>
<result>
<display-url>http://www.msnbc.msn.com/id/31806096/ns/politics-white_house/</display-url>
<redirect-url>http://app.dev.oneriot.com/?target=http%3A%2F%2Fwww.msnbc.msn.com%2Fid%2F31806096%2Fns%2Fpolitics-white_house%2F&oid=5589de1f8ad349e91b4a98703d93461e&queryId=aed6ea66-98ec-483d-861e-49731ed35c8f</redirect-url>
<title>Obama tax pledge unrealistic - White House- msnbc.com</title>
<snippet>President Barack <b>Obama</b> promised to fix health care and trim the federal budget deficit, all without raising taxes on anyone but the wealthiest...</snippet>
<first-share>
<user>
<service>DIGG</service>
<id>apackofmonkeys</id>
</user>
<time>1247092077</time>
</first-share>
<shares-list>
<shares>
<service>DIGG</service>
<total>2</total>
</shares>
</shares-list>
</result>
<result>
<display-url>http://lsminsurance.ca/life-insurance-canada/2009/07/health-insurance-a-challenge-for-obama</display-url>
<redirect-url>http://app.dev.oneriot.com/?target=http%3A%2F%2Flsminsurance.ca%2Flife-insurance-canada%2F2009%2F07%2Fhealth-insurance-a-challenge-for-obama&oid=2540d65a5aa9485c29aea22f7de3209f&queryId=aed6ea66-98ec-483d-861e-49731ed35c8f</redirect-url>
<title>Health Insurance: A Challenge for Obama</title>
<snippet>Remember the McCain and <b>Obama</b> health care plan battle? The main difference between the two plans was primarily the candidates' stand towards the...</snippet>
<first-share>
<user>
<service>DIGG</service>
<id>jonclayton</id>
<image>
<url>/users/jonclayton/l.png</url>
</image>
</user>
<time>1247082641</time>
</first-share>
<shares-list>
<shares>
<service>DIGG</service>
<total>7</total>
</shares>
</shares-list>
</result>
<result>
<type>VIDEO</type>
<display-url>http://www.youtube.com/watch?v=KX-G6mxLuWQ</display-url>
<redirect-url>http://app.dev.oneriot.com/?target=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DKX-G6mxLuWQ&oid=bd12931fc4b6663ddf304ca3a46f3bf0&queryId=aed6ea66-98ec-483d-861e-49731ed35c8f</redirect-url>
<title>YouTube - Fox News Jokes About Killing Obama</title>
<snippet>While commenting on Hillary's RFK gaffe, Liz Trotta on Fox News Channel first referred to Barack <b>Obama</b> as &quot;Osama&quot; and then laughed...</snippet>
<thumbnail>
<url>http://media.dev.oneriot.com/images_120x90/074/0BCF5C771279F6E6022871FABF042F64.jpg</url>
</thumbnail>
<media-duration>15000</media-duration>
<first-share>
<user>
<service>TWITTER</service>
<id>AnthonyJPorath</id>
<image>
<url>http://s3.amazonaws.com/twitter_production/profile_images/300710156/070909_mileytable_normal.jpg</url>
</image>
</user>
<time>1247094368</time>
<comment>http://bit.ly/ryyPm
Just found this. Another one of the MANY things I despise about Fox News. Lack of respect.</comment>
</first-share>
<shares-list>
<shares>
<service>TWITTER</service>
<total>1</total>
</shares>
</shares-list>
</result>
</result-list>
</search-results>
Though the vocabulary used in search responses is consistent across formats, the specific syntax differs. The following sections describe those specifics based upon the value of the format request parameter.
Each format description includes all possible fields; see the field descriptions for details about when fields are included or omitted, as well as what each field means.
JSONP
The OneRiot API supports a variant of JSONP that uses the fixed callback name com_oneriot_search_results. The callback parameter usually provided in JSONP requests is allowed but ignored. The results object contains all of the data needed to link the results object to the corresponding request: the query, type, order, page number, etc.
com_oneriot_search_results(
{
"version": "1.0",
"query": "[query]",
"type": "[type]",
"order": "[order]",
"time": [seconds since epoch],
"maxAge": [seconds],
"totalResults": [estimated total number of results available],
"pageNumber": [page number],
"pageSize": [page size],
"resultList":
[
{
"type": "[result type]",
"displayUrl": "[URL to display to user]",
"redirectUrl": "[URL that must be used for navigation]",
"title": "[title]",
"snippet": "[snippet]",
"thumbnail":
{
"url": "[thumbnail image URL]",
"width": [thumbnail width in pixels],
"height": [thumbnail height in pixels]
},
"firstShare":
{
"user":
{
"service": "[service identifier]",
"id": "[user identifier]",
"image":
{
"url": "[user image URL]",
"width": [user image width in pixels],
"height": [user image height in pixels]
}
},
"time": [seconds since epoch],
"comment": "[comment]"
},
"sharesList":
[
{
"service": "[service identifier]",
"total": [number of times this result shared on this service]
},
.
.
.
]
},
.
.
.
]
}
)
XML
<?xml version="1.0" encoding="UTF-8"?>
<search-results xmlns="http://xmlns.oneriot.com/api/1.0/">
<version>1.0</version>
<query>[query]</query>
<type>[type]</type>
<order>[order]</order>
<time>[seconds since epoch]</time>
<max-age>[seconds]</max-age>
<total-results>[estimated total number of results available]</total-results>
<page-number>[page number]</page-number>
<page-size>[page size]</page-size>
<result-list>
<result>
<type>[result type]</type>
<display-url>[URL to display to user]</display-url>
<redirect-url>[URL that must be used for navigation]</redirect-url>
<title>[title]</title>
<snippet>[snippet]</snippet>
<thumbnail>
<url>[thumbnail image URL]</url>
<width>[thumbnail width in pixels]</width>
<height>[thumbnail height in pixels]</height>
</thumbnail>
<media-duration>[media duration in seconds]</media-duration>
<first-share>
<user>
<service>[service identifier]</service>
<id>[user identifier]</id>
<image>
<url>[user image URL]</url>
<width>[user image width in pixels]</width>
<height>[user image height in pixels]</height>
</image>
</user>
<time>[seconds since epoch]</time>
<comment>[comment]</comment>
</first-share>
<shares-list>
<shares>
<service>[service identifier]</service>
<total>[number of times this result shared on this service]</total>
</shares>
.
.
.
</shares-list>
</result>
.
.
.
</result-list>
</search-results>
