-
Notifications
You must be signed in to change notification settings - Fork 59
RESTful API
Bryan Oakley edited this page Jul 20, 2014
·
1 revision
The hub provides a RESTful interface to return information about keywords. The interface closely matches the URL scheme used for displaying the documentation in the website. Following are typical URLs:
- http://localhost:7070/api/keywords
- http://localhost:7070/api/keywords/builtin
- http://localhost:7070/api/keywords/builtin/evaluate
You can search through all keywords, or the keywords in a library, by giving the pattern
argument.
Search patterns match anywhere in the string. To search for a keyword that begins with a string, prefix the pattern with a caret. To search for a keyword that ends with a pattern, append a dollar sign.
- http://localhost:7070/api/keywords?pattern=should
- http://localhost:7070/api/keywords?pattern=^should
- http://localhost:7070/api/keywords?pattern=numbers$
- http://localhost:7070/api/keywords/builtin?pattern=should
- http://localhost:7070/api/keywords/builtin?pattern=^should
- http://localhost:7070/api/keywords/builtin?pattern=should$
When searching for a list of keywords, the data will be returned in the following JSON format:
{
"keywords": [
{
"api_keyword_url": "...",
"api_library_url": "...",
"args": "[\"text=\"]",
"doc": "...",
"htmldoc": "...",
"library": "...",
"name": "...",
"synopsis": "..."
},
{...}, ...
]
}
When fetching the results for a single keyword, the data is in the following format:
{
"args": [..],
"doc": "...",
"library": "...",
"library_url": "...",
"name": "..."
}