In [ ]:
import sys
sys.path.insert(0, '../brainspell')

from json_api import *
from github_collections import *
from websockets import api_call

In [ ]:
api_call(RandomQueryEndpointHandler)

In [ ]:
api_call(QueryEndpointHandler, {
    "q": "brain"
})

In [ ]:
response = api_call(ArticleEndpointHandler, {
    "pmid": 21382353
})
response

In [ ]:
start = 0
all_articles = []

while True:
    # get all of the results returned by the query, in groups of 10
    response = api_call(QueryEndpointHandler, {
        "q": "vision",
        "start": start
    })
    # break out of the loop when there are no more results
    if response["start_index"] != -1:
        all_articles.extend(response["articles"])
        start += 10
    else:
        break

all_articles