Skip to main content

Open Interest

Open interest for the futures tracking a commodity.

Endpoint

GET /commodity/v1/openInterest

Authentication: Standard plan. Requires a valid platform API key (X-Primit-API-Key) tied to an active Standard plan (标准套餐) subscription or above. See Authentication.

Query parameters

NameTypeRequiredDefaultNotes
symbolstringYesCommodity code, e.g. XAU (gold), WTI (crude oil).
periodstringNo1dAggregation period.
limitintegerNo30Number of data points to return.

Response — 200 OK

{
"symbol": "XAU",
"openInterest": "458213",
"time": 1745884800000
}

Errors

HTTPCause
401Missing or invalid X-Primit-API-Key.
403No active Standard plan (subscription expired or never purchased).
404symbol not found.
422Missing symbol.

Example

curl -s "https://api.pipai.org/commodity/v1/openInterest?symbol=XAU" \
-H "X-Primit-API-Key: $PRIMIT_API_KEY"