HTML and JSON API
From Seeks
(Redirected from Seeks JSON Search API)
Returns result snippets in response to a query in HTML or JSON format.
Notice: Seeks JSON search API is available for versions of Seeks >= 0.2.2 (Bubs release).
Contents |
URL
http://seeks_node/search?output=html
http://seeks_node/search?output=json
where seeks_node should be replaced with the address of the seeks node you would like to search from.
formats
html
json
HTTP Method
GET
Resources
text search:
search
image search:
search_img
node information
info
Requires Authentification
none
API Rate Limit
none
Info Call
Returns information about the running Seeks node. (JSON only). Example:
Returns:
{
version: "0.3.3"
code-status: "stable"
url-source-code: http://seeks.git.sourceforge.net/git/gitweb.cgi?p=seeks/seeks;a=tree
thumbs: "off"
content-analysis: "off"
clustering: "on"
}
Search Parameters
- q: Required. The text to search for. See the queries section for examples on the format supported by this parameter.
- action: Required. The action to be performed, possible values are:
- expand: Expansion, that is the search for results. Requires an additional parameter, expansion that specifies the depth of the search.
- page: Requests a given page number. Requires an additional parameter, page that specifies the page number.
- types: Requests a grouping of results per type.
- clusterize: Requests an automated grouping of results based on their content. Requires an additional parameter clusters that specifies the maximum number of clusters (groups).
- similarity: Returns a subset of all results, those that are similar to a reference content. Requires an additional parameter, id that specifies the id of the reference content.
- expansion: Specifies the requested depth of the search, the higher, the more results are fetched and processed. Goes along with action=expand.
- page: Specifies the number of the requested page. Goes along with action=page.
- rpp: Optional. Number of requested results per page. If unspecified, the number defined by the search node is used instead.
- clusters: Optional. Specifies the maximum number of clusters (groups) to be constructed. Goes along with action=clusterize, default is 10 clusters.
- id: specifies the id of a reference content, used along with action=similarity. The value of this parameter is obtained from a list of results, see the response format section for details.
- thumbs: Optional. Specifies whether a URI to a thumbails of every returned result is specified. Values are on or off.
- engines: Optional. Specifies a subset of search engines to be used in the websearch call. Values are yahoo, google, exalead and bing. (This parameter is for Seeks versions 0.2.3 and higher).
- Example: http://www.seeks-project.info/search_exp.php/search?output=json&page=1&q=django&expansion=2&action=expand&engines=yahoo,exalead
- For Seeks versions > 0.3.3, every engine parser can support several feeds. Feed selection uses ':' to separate the engine names and feeds.
- Example http://www.seeks-project.info/search_exp.php/search?output=json&page=1&q=seeks&expansion=1&action=expand&engines=twitter:identica
- safesearch: Optional. Specifies whether to use safe search in the image websearch call. Values are on or off (This parameter applies to image websearch only, and to Seeks versions 0.2.4 and higher).
- prs: Optional. Specifies whether personalization is active. Values are on or off.
Usage Notes
- Query strings should be URL encoded.
- All methods will return a 400 HTTP error if one or more parameters are missing.
- Similarity calls return a 404 HTTP error if the resource cannot be found.
Example queries
- http://www.seeks-project.info/search_exp.php/search?output=json&q=django&page=1&expansion=2&action=expand
- http://www.seeks-project.info/search_exp.php/search_img?output=html&q=django&page=1&expansion=1&action=expand
Search operators
- Language is automatically selected from the HTTP headers of the query.
- Language can be enforced and directly specified within the query, such as :fr paris bars or :en django, see here for more details.
JSON Response
yields:
{
"snippets": [
{
"id": 580798571,
"title": "Markov Chains",
"url": "http://www.dartmouth.edu/~chance/teaching_aids/books_articles/probability_book/Chapter11.pdf",
"summary": "Format de fichier: PDF/Adobe Acrobat - AfficherVotre navigateur n’est sans doute pas lié à un lecteur PDF. Google vous conseille d’afficher la version texte de ce document.With this information we form a Markov chain as follows. ..... A state in this Markov chain is a description of the color of each square. For this ...",
"seeks_meta": 1,
"seeks_score": 0.0466938,
"rank": 3,
"cite": "dartmouth.edu/~chance/teaching.../Chapter11.pdf",
"archive": "http://web.archive.org/web/*/http://www.dartmouth.edu/~chance/teaching_aids/books_articles/probability_book/Chapter11.pdf",
"engines": [
"google"
]
},
{
"id": 249952016,
"title": "Markov chain - Wikipedia, the free…",
"url": "http://en.wikipedia.org/wiki/Markov_chain",
"summary": "A Markov chain is a random process with the property that the next state depends only on the current state. It is a Markov model, named for Andrey Markov, for a particular type ...",
"seeks_meta": 2,
"seeks_score": 0.0270976,
"rank": 2.5,
"cite": "en.wikipedia.org/wiki/Markov_chain",
"cached": "http://cc.bingj.com/cache.aspx?q=markov+chain&d=4519482552617814&mkt=fr-FR&setlang=fr-FR&w=c2f87800,2e120828",
"archive": "http://web.archive.org/web/*/http://en.wikipedia.org/wiki/Markov_chain",
"engines": [
"google",
"bing"
]
}
],
"date": "Mon, 04 Oct 2010 16:05:22 GMT",
"qtime":0
}
qtime is the processing time of the query by the Seeks node.
Groups of results obtained with action=clusterize and action=types are returned in the form:
"clusters": [
{
"label": "markovchainmontecarlo monte time"
"snippets": [ ... ]
},
{
"label": "state edges states"
"snippets": [ ... ]
}
]
"date": "Thu, 06 May 2010 11:59:54 GMT",
"qtime": 3.79
}
