Open AccessOpen Source

SNP search engine v1.0.0


Calls can be made to SNiPhunter's API using HTTP GET requests


Example 1

Return objects to browser in JSON if they contain the reference SNP ID rs5743810:

http://sniphunter.sanbi.ac.za/PMCOAI_rs_articles?rs_number=rs5743810



Example 2

Return objects to browser in JSON if they contain both cancer and USF as keywords:

http://sniphunter.sanbi.ac.za/PMCOAI_rs_articles?keywords[]=cancer&keywords[]=USF



Example 3

Return a list containing each object's DOI (using Python 3) if the object contains reference SNP ID rs5743810:


import httplib2
import json
h = httplib2.Http()
resp, content = h.request("http://sniphunter.sanbi.ac.za/PMCOAI_rs_articles?rs_number=rs5743810")
assert resp.status == 200
result = content.decode("utf-8")
inJSON = json.loads(result)
for dictionary in inJSON:
    for key, value in dictionary.items():
        if key == "doi":
            print(value)
  

The above example can be amended by replacing the term doi in the second from last line with email_address, publication_date, pubmed_id, pubmed_file_name, keywords or rs_number_cited_in_article depending on what information is required.