Retrieve transaction statistics for an NDC
curl --request GET \
--url https://sandbox-api.instockrx.com/ndc-transaction-statistics \
--header 'X-InStockRx-Api-Key: <api-key>'const options = {method: 'GET', headers: {'X-InStockRx-Api-Key': '<api-key>'}};
fetch('https://sandbox-api.instockrx.com/ndc-transaction-statistics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox-api.instockrx.com/ndc-transaction-statistics"
headers = {"X-InStockRx-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"nationalDrugCode": "<string>",
"nationalDrugCodeNormalized": "<string>",
"window": "30d",
"transactionCount": 1,
"totalQuantity": "1",
"medianPricePerUnit": "42.50",
"meanPricePerUnit": "42.50",
"distinctSellerCount": 1,
"distinctBuyerCount": 1,
"asOf": "2023-11-07T05:31:56Z"
}Utility
Retrieve transaction statistics for an NDC
Scope: drugs:read.
Returns aggregated marketplace transaction history for a national drug code (median price, volume, count of distinct sellers, etc.).
GET
/
ndc-transaction-statistics
Retrieve transaction statistics for an NDC
curl --request GET \
--url https://sandbox-api.instockrx.com/ndc-transaction-statistics \
--header 'X-InStockRx-Api-Key: <api-key>'const options = {method: 'GET', headers: {'X-InStockRx-Api-Key': '<api-key>'}};
fetch('https://sandbox-api.instockrx.com/ndc-transaction-statistics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox-api.instockrx.com/ndc-transaction-statistics"
headers = {"X-InStockRx-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"nationalDrugCode": "<string>",
"nationalDrugCodeNormalized": "<string>",
"window": "30d",
"transactionCount": 1,
"totalQuantity": "1",
"medianPricePerUnit": "42.50",
"meanPricePerUnit": "42.50",
"distinctSellerCount": 1,
"distinctBuyerCount": 1,
"asOf": "2023-11-07T05:31:56Z"
}Authorizations
Headers
Which pharmacy in your group you are acting as. Required whenever your group holds more than one pharmacy — omitting it is then 400 missing-pharmacy-context. With exactly one pharmacy it may be omitted, but send it anyway: the call starts failing the day a second pharmacy is added.
Query Parameters
Response
200 - application/json
OK