Important Notes

Rate Limit

API has a rate limit. If the usage exceeds a certain amount, API usage will be temporarily restricted. The criteria for this restriction will be adjusted after confirming the usage status of everyone.

Paging of Responses

When the API response is too large, the response includes pagination_key. If pagination_key exists in the response, subsequent data can be retrieved by setting pagination_key in the following query. Please refer to the sample code of each API for the response format.

Sample Python code using pagination_key is shown below.

import requests
import json

# First search
idToken = "YOUR idToken"
headers = {"Authorization": "Bearer {}".format(idToken)}
r_get = requests.get("https://api.jquants.com/v1/method?query=param", headers=headers)
data = r_get.json()["data"]

# Re-search when large data is returned
# Re-search as long as pagination_key is included
while "pagination_key" in r_get.json():
    pagination_key = r_get.json()["pagination_key"]
    r_get = requests.get(f"https://api.jquants.com/v1/method?query=param&pagination_key={pagination_key}", headers=headers)
    data += r_get.json()["data"]
  • The pagination_key is set in the response message until all applicable data for the query is returned. If pagination_key is not set in the response message, all applicable data for the query has been returned.

  • The value of pagination_key changes with each paging.

Gzip compression on API Responses

The response from the API is changed to Gzip for the purpose of reducing data traffic.

It is assumed that basically no action is required on the client side due to this specification change, but some action may be required on the client side depending on the usage pattern. Please refer to the table below for details.

Impact depending on the usage pattern

Use or not use "Package*"Use or not use "Accept-Encoding:Gzip"Action required or not

Use the Package

Use above header (This header is set by default.)

No Action required (Compressed responses are automatically decompressed)

Not use thePackage

Use above header

Action required. Need to decompress responses properly. In the case of curl, "--compressed" option is necessary.

Not use above header

No Action required

* Generally refers to HTTP client libraries that are used when making RestAPI calls. e.g.) Libraries such as "requests" and "urllib" in python.

最終更新