API clients handle 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 is recommended to use the Core API clients described below for a more robust and intuitive way to interact with the JASPAR API rather than constructing HTTP requests and decoding responses.

Currently, Core API provides three clients:

As a way of getting started, you can interact with the JASPAR API using the sample calls provided below.

Command line client

# Install the command line client
$ pip install coreapi-cli
To interact with the API:
  1. # Load the schema document
  2. $ coreapi get https://jaspar2020.genereg.net/api/v1/docs
  3.  
  4. # Interact with the API endpoint
  5. $ 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=...
  6.  
  7. # For example
  8. 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
To interact with the API:
  1. import coreapi
  2.  
  3. # Initialize a client & load the schema document
  4. client = coreapi.Client()
  5. schema = client.get("https://jaspar2020.genereg.net/api/v1/docs")
  6.  
  7. # Interact with the API endpoint
  8. action = ["matrix", "list"]
  9. params = {
  10. "page": ...,
  11. "page_size": ...,
  12. "search": ...,
  13. "order": ...,
  14. "collection": ...,
  15. "name": ...,
  16. "tax_group": ...,
  17. "tax_id": ...,
  18. "tf_class": ...,
  19. "tf_family": ...,
  20. "data_type": ...,
  21. "version": ...,
  22. "release": ...,
  23. }
  24. result = client.action(schema, action, params=params)
  25.  
  26. # For example
  27. params = {
  28. "collection": 'CORE',
  29. "name": 'SMAD3',
  30. "tax_group": 'vertebrates',
  31. "version": 'latest',
  32. "release": '2018',
  33. }
  34. result = client.action(schema, action, params=params)

JavaScript client

  1. <!-- Load the JavaScript client library -->
  2. <script src="https://jaspar2020.genereg.net/static/rest_framework/js/coreapi-0.1.0.js"></script>
  3. <script src="https://jaspar2020.genereg.net/api/v1/docs/schema.js"></script>
To interact with the API:
  1. var coreapi = window.coreapi // Loaded by `coreapi.js`
  2. var schema = window.schema // Loaded by `schema.js`
  3.  
  4. // Initialize a client
  5. var client = new coreapi.Client()
  6.  
  7. // Interact with the API endpoint
  8. var action = ["matrix", "list"]
  9. var params = {
  10. page: ...,
  11. page_size: ...,
  12. search: ...,
  13. order: ...,
  14. collection: ...,
  15. name: ...,
  16. tax_group: ...,
  17. tax_id: ...,
  18. tf_class: ...,
  19. tf_family: ...,
  20. data_type: ...,
  21. version: ...,
  22. release: ...,
  23. }
  24. client.action(schema, action, params).then(function(result) {
  25. // Return value is in 'result'
  26. })

Sample calls

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