API clients handles the underlying details of how network requests are made and how responses are decoded. We are using Core API which is a format-independent Document Object Model for representing Web APIs. It's recommended to use below Core API clients for more robust and meaningful way to interact with your JASPAR API rather than constructing HTTP GET requests and decoding responses.

Currently, Core API provides three clients:

Further, you can interact with JASPAR API using Sample calls provided below.

Command line client

# Install the command line client
$ pip install coreapi-cli
# Load the schema document
$ coreapi get http://127.0.0.1:8000/api/v1/docs/

# Interact with the API endpoint
$ coreapi action matrix list -p page=... -p page_size=... -p search=... -p order=... -p collection=... -p name=... -p tax_group=... -p tax_id=... -p tf_class=... -p tf_family=... -p data_type=... -p version=... -p release=...

# For example
coreapi action matrix list -p collection=CORE -p tax_group=vertebrates -p version=latest -p name=SMAD3

Python client

# Install the Python client library
$ pip install coreapi
import coreapi

# Initialize a client & load the schema document
client = coreapi.Client()
schema = client.get("http://jaspar.genereg.net/api/v1/docs")

# Interact with the API endpoint
action = ["matrix", "list"]
params = {
    "page": ...,
    "page_size": ...,
    "search": ...,
    "order": ...,
    "collection": ...,
    "name": ...,
    "tax_group": ...,
    "tax_id": ...,
    "tf_class": ...,
    "tf_family": ...,
    "data_type": ...,
    "version": ...,
    "release": ...,
}
result = client.action(schema, action, params=params)

# For example
params = {
    "collection": 'CORE',
    "name": 'SMAD3',
    "tax_group": 'vertebrates',
    "version": 'latest',
    "release": '2018',
}
result = client.action(schema, action, params=params)

JavaScript client

<!-- Load the JavaScript client library -->
<script src="http://jaspar.genereg.net/static/rest_framework/js/coreapi-0.1.0.js"></script>
<script src="http://jaspar.genereg.net/api/v1/docs/schema.js"></script>
Interact with API.
var coreapi = window.coreapi  // Loaded by `coreapi.js`
var schema = window.schema    // Loaded by `schema.js`

// Initialize a client
var client = new coreapi.Client()

// Interact with the API endpoint
var action = ["matrix", "list"]
var params = {
    page: ...,
    page_size: ...,
    search: ...,
    order: ...,
    collection: ...,
    name: ...,
    tax_group: ...,
    tax_id: ...,
    tf_class: ...,
    tf_family: ...,
    data_type: ...,
    version: ...,
    release: ...,
}
client.action(schema, action, params).then(function(result) {
    // Return value is in 'result'
})

Sample calls

These are sample calls to API from different languages. You can create the query url by using our Live API