Drug Interaction Checker API

Introduction

Welcome to the Drug Interaction Checker API documentation. This API allows developers to easily check for potential interactions between various drugs and retrieve relevant information regarding interaction severity and associated risks. The API is designed to be fast, scalable, and secure, making it ideal for integration into healthcare applications, medical platforms, or any service requiring drug interaction checking.

Key Features:

  • Drug Interaction Checking: Instantly retrieve potential drug interactions, severity levels, and associated risks using our state-of-the-art API services.
  • API Key Authentication: Secure access with individual API keys for each user to ensure data integrity and track usage.
  • Request Count Tracking: Each request made by a user is tracked and can be used for rate-limiting, billing, or monitoring purposes.
  • Cost-efficient: Each interaction is processed at a very affordable fee, providing affordable access to our powerful API models.

How it Works:

  • Send a list of drugs to the API, and our AI model services will analyze their potential interactions.
  • The response will include the severity of the interaction and detailed information about the risks involved.
  • Track the number of requests made by each user and ensure they stay within the allocated request and token limits.

Authentication:

All requests to the API require an API key, which must be included in the request header. API keys are provided upon user registration and are used to authenticate requests, track usage, and enforce rate limits.

This documentation provides a comprehensive guide to the available endpoints, request and response formats, and error handling. We encourage you to explore the API and integrate it into your application seamlessly.

API Documentation

Base URL:
https://druginteractioncheckerapi-0235532ef5ed.herokuapp.com
Authentication

All endpoints require authentication using an API key. Include the API key in the request headers as follows:

x-api-key: YOUR-API-KEY
Endpoints
Get Drug Interaction and Request Count

Return drug interaction details and the current request count for the user.

URL: /api/v1/interactions/ci
Method: POST

Headers:

x-api-key: YOUR-API-KEY

Body:

{ "drugs": ["drug1", "drug2", "drug3"]
}

Response


{

"message": "Drug interaction retrieved successfully",

"interaction": {

"severity": "string",

"risks": "string"

},

"requestCount": "integer"

}

Description: This endpoint returns the interaction severity, risks, and the user’s request count without including input and output word/token details.

Example Request

Request Headers
x-api-key: YOUR-API-KEY
Body
{
"drugs": ["Aspirin", "Warfarin"]
}
Code Snippet
const axios = require('axios');
let data = JSON.stringify({
"drugs": [
"Aspirin",
"Warfarin"
]
});

let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://druginteractioncheckerapi-0235532ef5ed.herokuapp.com/api/v1/interactions/ci',
headers: {
'x-api-key': 'YOUR-API-KEY',
'Content-Type': 'application/json'
},
data : data
};

axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
Response
{
"message": "Drug interaction retrieved successfully",
"interaction": {
"severity": "major",
"risks": "The combination of Aspirin and Warfarin can increase the risk of bleeding due to their similar mechanism of action. Aspirin may interfere with the anticoagulant effect of Warfarin, leading to increased clotting or bleeding. Patients taking both medications should be closely monitored for signs of bleeding and their dosage may need to be adjusted."
},
"requestCount": 5
}
Error Responses

All endpoints return error responses in the following format when something goes wrong:

  • Status Code: 400 or 500
  • Response:
 { "error": "Detailed error message here" }
Rate Limiting

Each API key has a set request limit and a token usage limit, based on the user subscription plan. The limits reset at the beginning of each month.

Response Codes
CodeDescription
200OK – Request processed successfully
201Created – Resource created
400Bad Request – Validation error
401Unauthorized – Invalid or missing API key
404Not Found – Resource not found
500Internal Server Error

Rate Limiting

Each user has a request limit set when they register. The request cost for each API request is deducted from the user’s total available request count.

  • Request Limit: Maximum number of requests allowed per month.

If you exceed your limits, the API will return a 429 Too Many Requests or a 402 Payment Required error.


Support

For any issues, questions, or feedback, please contact our support at:


This documentation provides the essential information for developers to integrate your API into their systems.