Free Access Key Available 499,996 requests remaining

Access Provided with Whitelisted API Key

Key Information

Key: secret_699038a1-a1de-4f70-8e63-308f2c8caf48

Overview

briteAPI is currently accessible to all users via a whitelisted API key, which grants a limited number of free API requests. This key enables developers to explore and integrate our extensive data resources within their applications.

Terms of Use

  • The provided API key is intended solely for development purposes and must be utilized in accordance with our terms.
  • A quota of 500,000 requests is allocated to this key.
  • Each request made counts towards this quota.
  • Upon reaching the limit, the key will automatically deactivate.
  • Regular monitoring of usage is recommended to avoid unexpected service interruptions.
  • Should the key become inactive, please transition to your personal briteAPI key for continued access.
  • briteAPI may revoke access at any point should the key be misused.

Recommendations

  • Implement error handling to manage potential inactivity of the API key effectively.
  • Anticipate the need to switch to a personal API key to maintain uninterrupted service.
  • Refrain from using this key in production environments, as its long-term availability cannot be assured.

Liability

  • briteAPI disclaims responsibility for any service disruptions due to quota limitations.
  • Use of the whitelisted API key is at the user's own risk.

Your use of the whitelisted API key confirms your acceptance of these terms.

For assistance or further information, please reach out to our development support at support@britelink.io.

We appreciate your involvement with the briteAPI community!

BriteAPI V1

Welcome to BriteAPI, the comprehensive gateway to a world of healthcare and medical information. With BriteAPI, you gain access to a suite of powerful APIs designed to empower your applications with essential medical data and services. Whether you're building a healthcare app, conducting research, or innovating in the medical field, our RESTful API endpoints are here to facilitate your journey.

What BriteAPI Offers

BriteAPI provides a range of API endpoints that cover various facets of the medical landscape:

  • Drug Information: Access data that empowers developers and healthcare stakeholders to seamlessly integrate critical drug informations into their applications. This enables users to access up-to-date, comprehensive details about drug compositions, interactions, and products, facilitating informed decision-making and enhancing patient care in the digital healthcare landscape

  • Laboratory Tests:Access essential lab test information. Designed for developers and healthcare experts, it provides key details on tests, helping to improve patient care and support informed decisions in digital healthcare. Certainly! Here's the introduction for the Premises API:

  • Pharmacy Information: Access information about pharmacies. This API is tailored for developers, healthcare professionals, and regulatory authorities, offering comprehensive details on pharmacies. It enables accurate identification and verification of pharmacy data, aiding in regulatory compliance and enhancing healthcare services.

  • Telemedicine: Our Telemedicine API allows users to easily set up andd manage virtual consultations, connecting patients with healthcare providers from any location. Enhancing access to medical advice and care, making it more convenient and efficient for all involved parties.

  • Healthcare AI: The briteAI API enables users to harness artificial intelligence for the analysis of medical data and diagnosis of conditions, streamlining various healthcare processes for improved efficiency and accuracy.

  • Additional Medical APIs: In addition to our core offerings, BriteAPI continues to expand its range of medical APIs. Explore our growing library to find solutions that fit your unique requirements.

Compliance with Industry Standards

We understand the critical importance of data security and privacy in the healthcare industry. We are proud to adhere to industry standards and regulations, including:

  • HIPAA (Health Insurance Portability and Accountability Act): BriteAPI is fully compliant with HIPAA regulations to safeguard the confidentiality and integrity of protected health information (PHI). We employ strict security measures and encryption protocols to ensure the secure transmission and storage of sensitive healthcare data.

  • HL7 (Health Level Seven International): Our APIs are packaged with HL7 standards and formats, facilitating interoperability and seamless data exchange among healthcare systems and applications. You can trust BriteAPI to deliver data in HL7-compliant formats, promoting consistency and accuracy.

  • FHIR (Fast Healthcare Interoperability Resource): BriteAPI adopts the FHIR framework to persistently and securely handle healthcare information. We prioritize data integrity, confidentiality, and availability, ensuring that your sensitive healthcare data is protected at all times.

Why Choose BriteAPI?

Our commitment to excellence and compliance is reflected in every aspect of our API:

  • RESTful Design: BriteAPI follows a RESTful architecture, providing predictable, resource-oriented URLs for easy integration. We utilize standard HTTP response codes to communicate API errors, making troubleshooting straightforward.

  • Security: Your data security is our top priority. We implement robust authentication measures to ensure your interactions with BriteAPI are safe and protected.

  • Flexibility: BriteAPI supports multiple programming languages, allowing you to seamlessly integrate our services into your preferred development environment. Code examples in various languages are available for your convenience.

  • Consistent Data Format: Whether you're fetching medical information, telehealth data, or AI-driven insights, BriteAPI delivers JSON responses. Our API libraries are designed to convert these responses into language-specific objects, simplifying your coding process.

Join Our Community

Embark on a transformative journey with BriteAPI and become part of a growing community that's reshaping the landscape of medical data and services. Dive into our comprehensive documentation and discover the diverse capabilities of our APIs. Engage with fellow developers and healthcare innovators in our forums, where ideas flourish and collaboration is encouraged.


Getting Started

This guide will help you get started with BriteAPI and provide you with the necessary information to access our services securely.

Creating an Account

  1. Visit BriteLink Signup to create your BriteLink account.
  2. Follow the registration process to set up your account with the required information.
  3. After successful registration, you will have access to your BriteLink Developer Dashboard.

Developer Dashboard

Access your Developer Dashboard to manage your API usage metrics, billing information, and more. This is where you can monitor your usage and keep track of your API keys.

To access your Developer Dashboard:

  1. Log in to your BriteLink account.
  2. Navigate to the Developer Dashboard.

Secure Your API Key

Your API Key is a critical component for accessing BriteAPI securely. Treat it like a secret and do not share it with anyone. It will look something like this: secret_********-****-****-****-********.

Your API Key provides you with access to BriteAPI services, allowing you to retrieve valuable medical data and integrate it into your applications.

API Usage and Billing

BriteAPI offers metered usage, and you can find detailed pricing information on the Pricing Page on our website. Monitor your API usage through the Developer Dashboard to ensure you stay within your chosen pricing tier.

If you have any questions or need assistance, please don't hesitate to contact our support team. We're here to help you make the most of BriteAPI.

Happy Hacking!

Guides

Quickstart Tutorials

Get up and running quickly by building a sample application that integrates BriteAPI. This tutorial provides a hands-on introduction to using our services.

Drug Information

Learn how to harness the power of our Drug Information API. Discover what it is, what we offer, and how to utilize it for accessing detailed drug-related data.

Notice: COMING SOON.

Telemedicine

Explore the basics of building a telemedicine assistant with BriteAPI. Understand what telemedicine is, what our Telemedicine API offers, and how to start using it for remote consultations.

Healthcare AI

Dive into the world of healthcare AI using BriteAPI. Gain insights into what healthcare AI encompasses, what our Healthcare AI API offers, and how to apply it for data analysis and optimization in healthcare.

Tutorials

API Authentication

Master the essentials of API authentication to ensure secure access to BriteAPI. Learn how to protect your API keys and make authenticated requests.

API Portal Help

Navigate our API portal effectively. This guide covers the key features and functionalities of our developer portal, helping you make the most of our services.

Drug-Drug Interactions

Explore the intricacies of drug-drug interactions. This tutorial delves into how to use our APIs to access information about potential interactions between different medications.

Indications

Understand how to access data related to medical indications. Learn how our APIs can provide information about the recommended uses and conditions for specific drugs.

Product Concepts

Learn about product concepts within the medical field. This guide explains how to access data about various healthcare products and their attributes.

Key Concepts

Drug Information

Discover the fundamentals of drug information provided by BriteAPI. Learn what it is, what we offer, and how you can leverage this data for various applications.

Telemedicine

Get a grasp of telemedicine and its significance. Understand what BriteAPI offers in the realm of telemedicine and how it can revolutionize remote healthcare services.

Healthcare AI

Uncover the potential of healthcare AI with BriteAPI. Explore what healthcare AI encompasses, the capabilities of our Healthcare AI API, and how it can drive innovation in the medical field.

Resources

Access additional resources to enhance your experience with BriteAPI:

  • Experiment in the Playground: Test and experiment with our APIs in a controlled environment.
  • Read the API Implementation Reference: Dive into the technical details of our API endpoints and parameters.
  • Visit the Help Center: Find answers to common questions and troubleshoot issues.
  • View the Current API Status: Stay updated on the status and availability of our APIs.
  • Check out the BriteAPI Developer Forum: Join discussions, share insights, and connect with fellow developers.
  • Learn About Our Usage Policies: Familiarize yourself with our policies to ensure compliance and responsible use of our APIs.

At BriteAPI, we prioritize the protection of user data and maintain strict data privacy standards. Rest assured that your data is handled with the utmost care and security.

BriteAPI JS SDK

The official JavaScript SDK for interfacing with briteAPI. This SDK simplifies interacting with briteAPI services directly from your JavaScript-based applications, whether in a Node.js, browser, or Next.js environment.

Features

  • Easy-to-use asynchronous methods for making HTTP requests to briteAPI endpoints.
  • Comprehensive support for all briteAPI endpoints.
  • Designed for versatility across server-side, client-side, and Next.js applications.

Installation

Install the package via npm:

npm install briteapi --save

Or, if you prefer yarn:

yarn add briteapi

Usage - see complete documention

General Setup

First, import the SDK and initialize it with your API key:

Node.js or Vanilla JavaScript

const { BriteAPI } = require("briteapi");
const briteAPI = new BriteAPI("your_api_key_here");

ES6 or TypeScript

import { BriteAPI } from "briteapi";
const briteAPI = new BriteAPI("your_api_key_here");

Making Requests

When making API requests using the BriteAPI SDK, it's important to remember that the SDK is pre-configured with the base URL (https://www.britelink.io/api/). This means you should not include the base URL in your endpoint strings; simply start with the API version and endpoint path.

Basic Endpoint

For primary endpoints, start directly with the version (v1/) followed by the endpoint name. Do not add the base URL (https://www.britelink.io/api/), as the SDK already handles this for you.

// Correct usage - No need to specify the full URL
briteAPI
  .fetch("v1/drugs")
  .then((data) => console.log(data))
  .catch((error) => console.error("Error:", error));

Secondary and Quaternary Endpoints

Similarly, for accessing secondary or quaternary endpoints, you only need to specify the endpoint path starting from the version indicator (v1/), followed by the resource name and any required parameters or IDs. The SDK takes care of appending this to the base URL.

Example for a secondary endpoint:

const drugId = "12345"; // Example ID
// Just use the endpoint and the SDK will append it to the base URL
briteAPI
  .fetch(`v1/drugs/${drugId}`)
  .then((data) => console.log(data))
  .catch((error) => console.error("Error:", error));

And for a quaternary endpoint with additional query parameters:

const drugId = "12345"; // Example ID for the primary resource
// Directly specify the endpoint with parameters; no need for the full URL
briteAPI
  .fetch(`v1/drugs/${drugId}/details?f=true&cursor=someValue`)
  .then((data) => console.log(data))
  .catch((error) => console.error("Error:", error));

Dynamic Parameters

For dynamic parameters such as IDs, use JavaScript template literals for ease of insertion into the endpoint string. Remember, there's no need to add the base URL at the beginning of your endpoint string.

Example using a dynamic parameter:

const userId = "abc123";
// Directly start with the API version and endpoint path
briteAPI
  .fetch(`v1/users/${userId}`)
  .then((data) => console.log(data))
  .catch((error) => console.error("Error:", error));

For specific end points refer to the menu on your left


Next.js Projects

Setup Environment Variables

For Next.js applications, it's recommended to use environment variables to store your API key. Add your API key to your .env.local file:

NEXT_PRIVATE_BRITEAPI_KEY=your_api_key_here

Using the SDK in Next.js

Then, you can use the SDK in your pages or API routes as follows:

// page.jsx
"use client";
import React, { useState, useEffect } from "react";

import { NextBriteAPI } from "briteapi";

const SDK = () => {
  const [data, setData] = useState(null);
  const [error, setError] = useState(null);

  useEffect(() => {
    const fetchData = async () => {
      const briteAPI = new NextBriteAPI(
        "secret_699038a1-a1de-4f70-8e63-308f2c8caf48"
      );
      try {
        const fetchedData = await briteAPI.fetch("v1/drugs");
        setData(fetchedData);
      } catch (error) {
        console.error(error);
        setError(error);
      }
    };

    fetchData();
  }, []); // Empty dependency array means this effect runs once on mount

  return (
    <main className="max-w-5xl m-auto w-full px-4">
      <h1>Hello from BriteLink SDK</h1>
      {error && <p>Error fetching data</p>}
      {data ? (
        <pre>{JSON.stringify(data, null, 2)}</pre> // Pretty print the JSON data
      ) : (
        <p>Loading...</p>
      )}
    </main>
  );
};

export default SDK;

Available Methods

  • fetch(endpoint): Makes a GET request to the specified briteAPI endpoint.

Handling Errors

The SDK throws errors when requests fail. It's important to handle these in your application:

briteAPI
  .fetch("nonexistent_endpoint")
  .then((data) => console.log(data))
  .catch((error) => console.error("Error:", error.message));

Contributions

Contributions are very welcome! Feel free to open issues or submit pull requests on our GitHub repository.

Support

For support, please open an issue on GitHub or reach out to our support team directly.

License

This SDK is available under the MIT License. For more details, see the LICENSE file.


Download JS & NEXT JS SDK

Drug Information API

Versioning

The Drug Information API is versioned to provide stability and flexibility. This documentation specifically covers Version 1 (V1) of the API. When making requests to the API, always use the 'v1' version in your URLs.

The base URL for the Drug Information API is as follows:

  • V1: https://www.britelink.io/api/v1/drugs

Please note that while these base URLs are currently available, they may be deprecated in future versions. Be sure to stay updated with our API changes to ensure compatibility.

Call to Action

Your feedback and engagement are valuable to us! If you need assistance with using the API, wish to contribute to its development, encounter a bug, or can't find a specific endpoint, don't hesitate to reach out to our team.

Here's how you can get in touch with us:

Our dedicated support and development team is here to assist you promptly. Your input helps us improve the API and ensures that it meets your needs effectively. We appreciate your involvement in making the Drug Information API even better!

Overview

The Britelink Drug Information API, serves as a comprehensive endpoint for accessing a wide range of information related to drugs. Whether you're a healthcare professional, researcher, or developer, our API empowers you to retrieve in-depth drug information, facilitating various applications such as:

  • Drug research and analysis
  • Clinical decision support systems
  • Medication management solutions
  • Pharmacovigilance and adverse event monitoring
  • Drug interaction checking
  • Healthcare mobile apps and websites and many more

Our API is designed to deliver industry standard drug data to enhance the quality of healthcare services and research projects. By leveraging this API, you can access vital details about drug formulations, indications, contraindications, interactions, side effects, and much more.

Now, let's dive into the specifics of how to integrate and utilize our API effectively. In the following sections, you'll find detailed information on endpoints, authentication, request and response examples, error handling, and best practices to make the most of the Drug Information API.

Overview

To access the Drug Information API authentication is required. We use API keys for a secure and straightforward authorization process.

Obtaining and Using an API Key

  1. Request an API Key: To obtain an API key, please signup and proceed to your Developer Dashboard. Each key is uniquely associated with your environment (development or production).

  2. Include the API Key in Requests: Use the Authorization header to include your API key in all API requests. The header format should be "Bearer BRITE_API_KEY". Replace BRITE_API_KEY with your actual API key or make use of environment variables. Here's an example using cURL:

    curl -L 'https://www.britelink.io/api/v1/drugs'
    -H 'Authorization: Bearer BRITE_API_KEY'
    
  3. Key Security: Your API key should be kept confidential. Avoid exposing it in client-side code or public repositories. Securely store it, such as in environment variables.You can add this key in a .env for example BRITE_API_KEY =secret**\*\*\*\*\***-\***\*-\*\***-\***\*-**\*\*\*\*\*\*

  4. HTTPS Requirement: All API requests must be made over HTTPS. Unencrypted HTTP requests are not supported and will be rejected.Plain HTTP only works in local environment.

Example: Using the API Key in a JavaScript Application

const apiKey = process.env.BRITE_API_KEY;

const fetchData = async () => {
  try {
    const response = await axios.get("https://www.britelink.io/api/v1/drugs", {
      headers: {
        Authorization: `Bearer ${apiKey}`, // Correct header for authentication
      },
    });
    console.log(response); // Process the response as needed
  } catch (error) {
    console.error("Error fetching data:", error);
  }
};

Middleware Configuration

Our middleware is tailored to manage CORS (Cross-Origin Resource Sharing) and authentication headers. It is designed to accept the Authorization header, following the Authorization: Bearer BRITE_API_KEY format, for secure authentication.

Important Note for API Users

When making requests to our API, ensure you use the Authorization: Bearer YOUR_API_KEY format. Incorrect header usage will result in authentication failure.

{
    "success": false,
    "error": "Must have a valid API key!"
}

Support

For assistance in obtaining an API key, please visit your Developer Dashboard or contact us.

Content Types

Response Body

JSON Format

To retrieve data from the BriteAPI V1, the response format defaults to JSON. Currently, JSON is the only available format. To specify JSON format explicitly, you have the following options:

Using the Accept Header

curl -L 'https://www.britelink.io/api/v1/drugs' \
-H 'Authorization: Bearer BRITE_API_KEY' -H 'Accept: application/json'

Using the .json File Extension

You can also indicate your preference for JSON encoding by appending ".json" to the endpoint:

curl -L 'https://www.britelink.io/api/v1/drugs.json' \
-H 'Authorization: Bearer BRITE_API_KEY'

The response will be in JSON format by default.

Request Headers

Header Descriptions

  • Accept: This header specifies the requested MIME type of the response. When used, it helps ensure that the response is in the desired format.

Response Headers

Header Descriptions

  • Content-Type: This header indicates the MIME type of the response body. In the BriteAPI V1 , the Content-Type header will typically be set to indicate that the response is in JSON format.

Request Body

Sending Data via POST Request

For API calls that use a POST request to send data to the API (e.g., when finding drug-drug interactions with mixed input), you must set the appropriate Content-Type header.

Example POST Request

curl -L -X POST "https://www.britelink.io/api/v1/drugs/ddi" \
-H "Content-Type: application/json" \
-H 'Authorization: Bearer BRITE_API_KEY' \
-H "Cache-Control: no-cache" -d '{
  "ndc": ["0143-9503", "0056-0173"],
  "briteId": ["brite_0x123", "brite_0x456"],

}'

In this example, we set the Content-Type header to "application/json" to indicate that the request body contains JSON-encoded data.

Request Headers

Header Descriptions

  • Content-Type: This header specifies the MIME type of the request body, indicating that it contains JSON data.

Handling HTML Content in BriteAPI Responses

Overview

BriteAPI DrugInfo provides richly formatted data, including fields like description and clinicalDescription, in HTML format. This formatting is ideal for applications that display content in a web browser, as it allows for a rich presentation including styles and images. However, some applications may require data in a plain text format, devoid of any HTML markup. To accommodate this need, we provide guidelines and a utility function for stripping HTML from response data.

Rendering HTML Content

To render HTML content from BriteAPI responses, you can use the dangerouslySetInnerHTML attribute. This attribute allows you to render HTML content as-is, including any styles it contains. Here's an example of rendering HTML content using React:

import React from "react";

const DrugDetailsPage = ({ drugDetails }) => {
  const renderDescriptionWithStyles = (description) => {
    return { __html: description };
  };

  return (
    <div className="container mx-auto p-4">
      <h1 className="text-3xl font-semibold mb-4">Drug Details</h1>
      {drugDetails ? (
        <div className="bg-white p-6 rounded-lg shadow-md">
          <h2 className="text-xl font-semibold mb-2">Trade Name:</h2>
          <p className="text-gray-800">{drugDetails.tradeName}</p>

          <h2 className="text-xl font-semibold mb-2">Generic Name:</h2>
          <p className="text-gray-800">{drugDetails.genericName}</p>

          <h2 className="text-xl font-semibold mb-2">Description:</h2>
          <div
            className="text-gray-800"
            dangerouslySetInnerHTML={renderDescriptionWithStyles(
              drugDetails.description
            )}
          ></div>

          {/* Add more drug details here */}
        </div>
      ) : (
        <p className="text-red-500">Drug details not found.</p>
      )}
    </div>
  );
};

export default DrugDetailsPage;

In this code, we define a renderDescriptionWithStyles function that sets the HTML content with styles using the dangerouslySetInnerHTML attribute. This allows you to render HTML content as intended.

Best Practices and Security Considerations

  • Security: When rendering HTML content, consider the security implications, especially if the text will be re-rendered in a web environment. Ensure to escape or encode the text to prevent Cross-Site Scripting (XSS) vulnerabilities.
  • Data Integrity: Ensure that the HTML rendering process does not inadvertently alter the informational content of the data.
  • Performance: Consider the performance implications if you're rendering large volumes of data. The dangerouslySetInnerHTML attribute is suitable for moderate-sized strings.

Rendering HTML content using the dangerouslySetInnerHTML attribute offers a straightforward solution for displaying HTML content from the BriteAPI DrugInfo. This functionality ensures greater flexibility and broader application compatibility for users of the API.

Why Strip HTML?

In certain scenarios, such as rendering text in a non-HTML environment or processing text data for analysis, you might prefer to have these fields in plain text. Stripping HTML is also useful to ensure compatibility with systems that do not support HTML rendering or where HTML could introduce security vulnerabilities.

Utility Function: stripServerHtml

To help users handle HTML content efficiently, you can create a utility function stripServerHtml. This function is designed to remove all HTML tags from a string, leaving plain text.

Function Definition

/**
 * Strips HTML tags from a given string.
 * @param {string} html - The string containing HTML.
 * @returns {string} - String with HTML tags removed.
 */
export function stripServerHtml(html) {
  if (!html || typeof html !== "string") {
    return "";
  }
  return html.replace(/<[^>]*>?/gm, "");
}

Usage Example

Here’s how you can use stripServerHtml in a typical scenario:

import { stripServerHtml } from "path/to/utility";

// Assume drug is an object from the BriteAPI response
const drug = {
  description: "<p>Description with <strong>HTML</strong> tags.</p>",
  clinicalDescription: "<p>Clinical info with <em>HTML</em> tags.</p>",
};

// Sanitize the HTML content
const sanitizedDrug = {
  ...drug,
  description: stripServerHtml(drug.description),
  clinicalDescription: stripServerHtml(drug.clinicalDescription),
};

console.log(sanitizedDrug);

Best Practices and Security Considerations

  • Security: When stripping HTML, consider the security implications, especially if the text will be re-rendered in a web environment. Ensure to escape or encode the text to prevent Cross-Site Scripting (XSS) vulnerabilities.
  • Data Integrity: Ensure that the HTML stripping process does not inadvertently alter the informational content of the data.
  • Performance: Consider the performance implications if you're processing large volumes of data. The stripServerHtml function is suitable for moderate-sized strings.

Conclusion

The stripServerHtml utility function offers a straightforward solution for converting HTML content from the BriteAPI DrugInfo into plain text. This functionality ensures greater flexibility and broader application compatibility for the users of the API.


Pagination

Many API endpoints support pagination in the form of cursors. To ensure quick response times, pagination is enabled by default for these endpoints.

Endpoint

GET https://www.britelink.io/api/v1/drugs

Query Parameters

ParameterDescriptionRequiredDefault
cursorA unique identifier for the starting point of the query. Used for navigating through paginated results.OptionalNone (Fetches the first set of results)
BATCH_COUNTThe fixed number of results returned per page.No50
  • cursor (optional): A unique identifier for the starting point of the query. If omitted, the API fetches the first set of results.
  • BATCH_COUNT (default = 50): Number of results per page. This is a fixed point provided by the internal API and cannot be changed. Trying to change this will result in a Bad Request error. see more on Erros.

Request Example

curl -X GET 'https://www.britelink.io/api/v1/drugs?cursor=yourCursorValue' \
-H 'Authorization: Bearer YOUR_API_KEY'

Authorization Header

Every request must include the Authorization header with a valid API key.

HeaderDescription
AuthorizationBearer token for API access. Format: Bearer YOUR_API_KEY

Response Structure

The response includes a list of drugs and a nextCursor value, which is used to fetch the next set of results.

{
  "drugs": [
    /* array of drug objects */
  ],
  "nextCursor": "nextCursorValue"
}

Understanding the Response

  • drugs: An array of drug information objects.
  • nextCursor: A string used to fetch the next set of results. If absent, it signifies the end of the dataset.

Using Cursors for Pagination

  • Initially, to fetch the first set of results, omit the cursor parameter.
  • In subsequent requests, use the nextCursor from the current response as the cursor parameter to fetch the next results.
  • The cursor is an opaque string and should not be modified.
  • The presence of a nextCursor indicates more results are available. If absent, it signifies the end of the dataset.

Client-Side Implementation

Initial data fetching will provide both the data (drugs) and a nextCursor. Use the nextCursor to retrieve the next batch of results. Here's an updated example of the fetchData function:

const apiKey = process.env.BRITE_API_KEY;
let nextCursor = null;

const fetchData = async () => {
  try {
    const params = nextCursor ? { cursor: nextCursor } : {};
    const response = await axios.get("https://www.britelink.io/api/v1/drugs", {
      headers: { Authorization: `Bearer ${apiKey}` },
      params,
    });

    if (response.data && response.data.nextCursor) {
      nextCursor = response.data.nextCursor;
    }

    console.log(response.data);
  } catch (error) {
    console.error("Error fetching data:", error);
  }
};

fetchData(); // For initial data
// To fetch more data, you can call fetchData() again, such as on a button click or a scroll event.

Handling Larger Batch Requests

For automated pagination, particularly when fetching a large number of items (like 1000 drugs), a loop can be implemented on the client side to fetch all pages automatically. This loop continues to call the API using the nextCursor from the previous response, accumulating results until the desired number is reached or no more items are available.

Here's an example for automatically fetching up to 1000 drugs:

const apiKey = process.env.BRITE_API_KEY;
const MAX_DRUGS = 1000;

const fetchAllDrugs = async () => {
  let allDrugs = [];
  let nextCursor = null;
  let continueFetching = true;

  while (continueFetching) {
    try {
      const params = nextCursor ? { cursor: nextCursor } : {};
      const response = await axios.get(
        "https://www.britelink.io/api/v1/drugs",
        {
          headers: { Authorization: `Bearer ${apiKey}` },
          params,
        }
      );

      const { drugs, nextCursor: newCursor } = response.data;
      allDrugs.push(...drugs);
      nextCursor = newCursor;

      if (!nextCursor || allDrugs.length >= MAX_DRUGS) {
        continueFetching = false;
      }
    } catch (error) {
      console.error("Error fetching data:", error);
      continueFetching = false;
    }
  }

  return allDrugs.slice(0, MAX_DRUGS);
};

fetchAllDrugs().then((drugs) => {
  console.log(drugs); // Logs up to 1000 drugs
});

This approach ensures that users do not need to manually make subsequent calls for large data sets.


Get ALL Drugs

Endpoint

GET https://www.britelink.io/api/drugs

Description

This endpoint allows you to retrieve a list of drugs from the Britelink API. It supports pagination, enabling you to fetch a batch of drugs at a time. The retrieved data includes drug details, such as descriptions and clinical descriptions, which can be useful for various applications.

Read pagination for more details about this endpoint

Use Cases

Here are some scenarios where this endpoint can be particularly useful:

  • Healthcare App Integration: For managing patient medications, including prescription assistance and drug interaction checks.
  • Pharmacy Inventory Management: To keep track of available medications and their details for efficient stock management.
  • Educational Resource: For academic research and studies in pharmacology and healthcare training programs.
  • Patient Health Records: Enabling patients to manage and understand their medication regimens within personal health apps.
  • AI and Machine Learning: Providing a comprehensive dataset for training algorithms in drug recommendation and predictive analytics.
  • E-commerce Platforms: Utilized by online pharmacies to present detailed drug information to customers for informed purchasing.
  • Clinical Decision Support: Assisting clinicians in making informed decisions about drug prescriptions.
  • Regulatory Compliance: Aiding in pharmaceutical compliance and reporting requirements.
  • Health Analytics: For market research, pharmaceutical trends analysis, and healthcare reporting.

Drug Name Search

The Drug Name Search endpoint allows for quick retrieval of drugs/product information, ideal for use with autocomplete forms. This functionality helps in efficiently finding the correct drugs/products by searching for names or related terms.

API Request

Use the following API request to search for drugs:

curl -L 'https://www.britelink.io/api/v1/drug_names?q=tylenol' \
-H 'Authorization: Bearer BRITE_API_KEY'

Query Parameters

  • q (string): The name or partial name of the drug to search for.
  • f (boolean, default: false): Set to true to enable fuzzy search.

Example

const apiUrl = "https://www.britelink.io/api/v1/drug_names";

// Function to fetch drug suggestions
const fetchSuggestions = async (inputValue) => {
  try {
    const response = await axios.get(apiUrl, {
      headers: {
        Authorization: `Bearer ${apiKey}`,
      },
      params: { q: inputValue, f: true },
    });

    const suggestions = response.data.map((result) => ({
      id: result.id,
      name: result.tradeName,
    }));

    console.log(suggestions);
  } catch (error) {
    console.error("Error fetching suggestions:", error);
  }
};

Example Response

The API returns data in JSON format. Below is an example of the structure of the response (results may be abbreviated):

[
  {
    "id": "clrg9syik000fl908dgrpukj4",
    "tradeName": "NAPRODOX 50,ROBOL,ROBOL -50,ZODOX-50,NAPRODOX 10,DOXORUBICIN HYDROCHLORIDE SANDOZ,ADRIM-50",
    "genericName": "doxorubicin",
    "registrationNo": "2002/9.3.2/4046,2002/9.3.2/4047,2022/9.3.2/6327,2020/9.3.2/6039,2020/9.3.2/6038,2015/9.3.2/5093,2015/9.3.2/5093,2021/9.3.2/6074",
    "dateRegistered": "2022-09-23T00:00:00.000Z",

    "strength": "10MG/5ML,50MG/25ML,10MG,50 MG,2MG/ML",
    "form": "SOLUTION; INJECTION,",
    "applicantName": "SANDOZ SA (PTY) WATERFALL 5-LR, MAGWA CRESCENT WEST, JUKSKEI VIEW WATERFALL CITY SOUTH AFRICA",
    "principalName": "SANDOZ SA (PTY) WATERFALL 5-LR, MAGWA CRESCENT WEST, JUKSKEI VIEW WATERFALL CITY SOUTH AFRICA",
    "categoryId": "clror0sft001049uoqnicd85j",
    "foodInteractions": null,
    "levelOfAvailability": "B",
    "drugPriority": "E",
    "categoryType": "PRESCRIPTION_PREPARATIONS_9TH_SCHEDULE_PP10",
    "ispublished": false,
    "createdAt": "2024-01-16T11:28:15.549Z",
    "updatedAt": "2024-01-22T12:23:37.395Z",
    "chemicalStructure": [
      {
        "id": "clrorld9x000tla08uhywn70j",
        "name": "(8S,10S)-10-[(3-Amino-2,3,6-trideoxy-α-L-lyxo-hexopyranosyl)oxy]-8-glycoloyl-7,8,9,10-tetrahydro-6,8,11-trihydroxy-1-methoxy-5,12-naphthacenedione",
        "formula": "C27H29NO11",
        "molecularWeight": 543.52,
        "casNumber": "23214-92-8",
        "createdAt": "2024-01-22T10:08:23.925Z",
        "updatedAt": "2024-01-22T10:08:23.925Z",
        "drugId": "clrg9syik000fl908dgrpukj4"
      }
    ],
    "pharmacology": [
      {
        "id": "clrn4ny8x000pia08n8jb10vf",
        "tradeName": "Cisplatin",
        "genericName": null,
        "registrationNo": null,
        "dateRegistered": null,
        "description": null,
        "simpleDescription": null,
        "clinicalDescription": null,
        "strength": null,
        "form": null,
        "applicantName": null,
        "principalName": null,
        "categoryId": null,
        "foodInteractions": null,
        "levelOfAvailability": "A",
        "drugPriority": "N",
        "categoryType": "PRESCRIPTION_PREPARATIONS_9TH_SCHEDULE_PP",
        "ispublished": false,
        "createdAt": "2024-01-21T06:38:47.073Z",
        "updatedAt": "2024-01-21T06:38:47.073Z"
      }
    ]
  }
]

Search with Fuzzy Matching

Please note that our current fuzzy searching allows for handling incomplete names, not misspellings.

Parameters

ParameterRequired/OptionalDescriptionDefault ValueAcceptable Values
qRequiredThe drug name or product to search for.-strings and nums
fOptionalEnable fuzzy search. Set to true to allow partial and approximate matches.falsetrue, false

Example Request

Search for "Tylenol" with fuzzy matching enabled:

curl -L 'https://www.britelink.io/api/v1/drug_names?q=tyle&f=true' \
-H 'Authorization: Bearer YOUR_API_KEY'

Here, the current fuzz algorithm is capable of auto-completing words in a sequence. For example, if you search for 'tyle' or 'yle,' the algorithm will successfully find matches like 'tylenol.' However, if the 'q' parameter contains a misspelling or includes random letters not in the word sequence, the fuzzy search will fail, resulting in empty results. Make sure to provide accurate input for the best search results.

Future Updates

In the current API version (V1), this request returns all available fields for each drug name. Future updates will introduce additional parameters to customize the response, such as excluding specific data.

  • Fuzzy searching allows for handling misspellings and incomplete names, making the search more flexible and user-friendly.
  • By default, fuzzy searching is disabled. To enable it, set the fuzzing f parameter to true.
  • The fuzzer algorithm will be able to handle mispellings in the q

Use Case: Streamlining Medication Selection in Healthcare Applications

In healthcare applications, accurate and efficient drug identification is critical for healthcare professionals, pharmacists, and patients alike. The Drug Name Search endpoint can be leveraged to streamline the medication selection process in the following real-world scenarios:

  1. Auto-Predictive Medication Suggestions: Healthcare applications can utilize this endpoint to provide auto-predictive medication suggestions as healthcare providers type in a drug name during prescription creation or medication orders. As a healthcare provider enters the initial characters of a drug name, the fuzzy matching capability enables the system to suggest relevant medications quickly. This saves time and reduces the risk of selecting the wrong medication.

  2. Patient Medication History Retrieval: When accessing a patient's medication history, the endpoint allows healthcare professionals to search for a drug by name or related terms. This simplifies the retrieval of a patient's medication history and ensures that accurate information is readily available, aiding in better-informed medical decisions.

  3. Retail Pharmacy Drug Search: Retail pharmacy applications can implement this endpoint to assist customers in finding the exact medication they need. Patients can input partial drug names or related terms, and the system will provide a list of relevant medications, helping customers make informed choices while purchasing over-the-counter or prescription drugs.

  4. Inventory Management for Pharmacies: Pharmacies can use the endpoint to streamline inventory management. It enables pharmacists to quickly identify and restock drugs by searching for partial names or related terms. This ensures that pharmacies maintain an up-to-date inventory and can meet patient needs promptly.

  5. Clinical Decision Support Systems: Integrated into clinical decision support systems, the Drug Name Search endpoint aids healthcare professionals in making evidence-based decisions. By offering auto-completing and fuzzy search capabilities, it assists in identifying suitable medications during patient assessment and treatment planning.

By incorporating the Drug Name Search endpoint into healthcare applications, developers can enhance the user experience, reduce errors, and improve patient safety by simplifying the drug selection process. This functionality ensures that healthcare professionals and patients can access accurate medication information swiftly and conveniently.

Get a Specific Drug

Retrieve detailed information about a specific drug using its BriteLink ID.

HTTP Request:

GET https://www.britelink.io/api/v1/drugs/<ID>

Example Request:

curl -L 'https://www.britelink.io/api/v1/drugs/${ID}' \
-H 'Authorization: Bearer BRITE_API_KEY'

Example Request With References:

curl -L 'https://www.britelink.io/api/v1/drugs/clrw9ar1w0000jq081pukhhhu' \
-H 'Authorization: Bearer BRITE_API_KEY'

URL Parameters

ParameterDescription
IDThe BriteLink ID of the drug to retrieve.

Query Parameters

ParameterDefaultDescription
rfalseIf true, includes the list of references for this drug.

Example Response

{
  "id": "clrw9ar1w0000jq081pukhhhu",
  "tradeName": "ROCEPHIN",
  "genericName": "CEFTRIAXONE",
  "registrationNo": "84/20.1.1/1401",
  "dateRegistered": "1984-10-25T00:00:00.000Z",
  "description": "<p><br></p><p><img src=\"https://pubchem.ncbi.nlm.nih.gov/image/imgsrv.fcgi?cid=5479530&amp;t=l\" width=\"300\" height=\"300\" alt=\"Ceftriaxone.png\"></p><p><br></p><p>Ceftriaxone is a broad-spectrum, third-generation cephalosporin antibiotic. Chemically, it is known as (6R,7R)-7-[(2Z)-2-(2-amino-1,3-thiazol-4-yl)-2-(methoxyimino)acetamido]-3-{[(2-methyl-5,6-dioxo-1,2,5,6-tetrahydro-1,2,4-triazin-3-yl)sulfanyl]methyl}-8-oxo-5-thia-1-azabicyclo[4.2.0]oct-2-ene-2-carboxylic acid. Its molecular formula is C18H18N8O7S3, and it has a molecular weight of 554.58 g/mol.</p><p>Ceftriaxone ]e, it can be administered once or twice daily, which can be beneficial for patient compliance.</p>",
  "simpleDescription": "Ceftriaxone is a broad-spectrum third-generation cephalosporin antibiotic. It has a very long half-life compared to other cephalosporins and is highly penetrable into the meninges, eyes, and inner ear. Ceftriaxone has broader and stronger gram-negative coverage than first or second-generation cephalosporins, but worse activity against methicillin-susceptible S.aureus. Ceftriaxone is a commonly used antimicrobial due to its good activity against multi-drug resistant Enterobacteriaceae, its relatively safe adverse effect profile, and its long half-life which allows for the convenience of daily or twice-daily dosing.",
  "clinicalDescription": "<p><br></p><ul><li><span style=\"color: var(--tw-prose-bold);\">Indications and ...."
}

Handling HTML Content in Response

Some fields in the API response, such as description and clinicalDescription, are returned in HTML format. If your application requires plain text data, you can use the stripServerHtml utility function to remove HTML tags from these fields. This functionality is especially useful for applications that process or display content in non-HTML environments. For implementation details and usage, please refer to our Handling HTML Content documentation.


Get Drug Categories

Overview

This API endpoint retrieves the categories for a specific drug from a database. It provides detailed information about the drug's categories, including their names, IDs, and descriptions.

Endpoint

GET https://www.britelink.io/api/v1/drugs/{drugId}/categories

URL Parameters

  • drugId (required): The unique identifier for the drug for which categories are being requested.

Request

To retrieve categories for a specific drug, make a GET request to the endpoint with the drug's ID. The drug ID is typically obtained from a previous API call or from the application's interface.

Example request:

curl -L 'http://britelink.io/api/v1/drugs/{drugId}/categories' \
-H 'Authorization: Bearer YOUR_API_KEY'

Replace {drugId} with the actual BriteLink ID of the drug.

Javascript Example

const apiKey = process.env.BRITE_API_KEY;

// Function to fetch categories for a specific drug
const fetchData = async (drugId) => {
  try {
    const url = `http://britelink.io/api/v1/drugs/${drugId}/categories`; // Construct the URL with the drug ID

    const response = await axios.get(url, {
      headers: { Authorization: `Bearer ${apiKey}` },

      params,
    });

    console.log(response.data);
  } catch (error) {
    console.error("Error fetching data:", error);
  }
};

// In this example:

// - fetchData takes a drugId parameter.
// - The URL is dynamically constructed using the drugId.
// - When you want to fetch categories for a drug, you pass the drug ID to fetchData.

// Example usage
const exampleDrugId = "clrw9ar1w0000jq081pukhhhu"; // Replace with actual drug ID
fetchData(exampleDrugId); // Fetch categories for the specified drug ID

// To fetch more data for the same drug, you can call fetchData() again.

Response

The response is a JSON array containing objects with detailed information about each category related to the drug. Each object in the array includes the following fields:

  • id: A unique identifier for the category.
  • name: The name of the category.
  • meshId: The Medical Subject Headings (MeSH) ID associated with the category.
  • meshTreeNumbers: The MeSH tree numbers for the category.
  • atcCode: The Anatomical Therapeutic Chemical (ATC) code associated with the category.
  • atcLevel: The ATC code level.
  • categorizationKind: The kind of categorization (e.g., 'therapeutic').
  • synonyms: Array of synonyms related to the category.
  • description: A brief description of the category.

Example response:

{
  "levelOfAvailability": "C",
  "drugPriority": "V",
  "categories": {
    "id": "clqjkjarq000149khcr13qjke",
    "name": "Antibiotics",
    "meshId": "MESH54321",
    "meshTreeNumbers": "J01CR",
    "atcCode": "J01CR02",
    "atcLevel": 5,
    "categorizationKind": "Medical",
    "synonyms": "Anti-Infective Agents",
    "description": "Medications for bacterial infections"
  },
  "therapeuticCategories": [
    {
      "id": "clrwap5bk0001l408iuo4ml9y",
      "briteLinkId": "BR015",
      "name": "Cephalosporin Antibiotics",
      "meshId": " D002446",
      "meshTreeNumbers": "D02.065.589.099",
      "atcCode": "J01DD04",
      "synonyms": "Rocephin",
      "description": "Ceftriaxone is a third-generation cephalosporin antibiotic used to treat a wide range of bacterial infections. It works by inhibiting bacterial cell wall synthesis."
    }
  ]
}

Error Handling

The API returns the following HTTP status codes in case of errors:

  • 400 Bad Request: The request is invalid or missing required parameters.
  • 404 Not Found: No drug found with the provided ID.
  • 500 Internal Server Error: An error occurred on the server while processing the request.

Pagination and Filtering

This endpoint in V1 does not support

Security

Requests to this endpoint must include an authorization header with a valid API key.


Get Drug Indications

Overview

This API endpoint retrieves a list of indications linked to a specific drug. It provides detailed information about each indication, including its kind, off-label status, OTC use, and related conditions.

Endpoint

GET https://www.britelink.io/api/v1/drugs/{drugId}/indications

URL Parameters

  • drugId (required): The unique identifier for the drug for which indications are being requested.

Request

To retrieve indications for a specific drug, make a GET request to the endpoint with the drug's ID. The drug ID is typically obtained from a previous API call or from the application's interface.

Example request using cURL:

curl -L 'http://britelink.io/api/v1/drugs/{drugId}/indications' \
-H 'Authorization: Bearer YOUR_API_KEY'

Replace {drugId} with the actual Drug ID of the drug.

Response

The response is a JSON array containing objects with detailed information about each indication. Each object includes the following fields:

  • kind: The kind of indication (e.g., 'used_in_combination_to_treat').
  • off_label: A boolean indicating whether the indication is off-label.
  • otc_use: A boolean indicating over-the-counter use.
  • route: Array of routes of administration.
  • dose_form: Array of dose forms.
  • dose_strength: Array of dose strengths.
  • combination_type: The type of combination (e.g., 'regimen').
  • drug: Object containing the name and Drug ID of the drug.
  • condition: Object containing details of the condition associated with the indication.
  • combination_drugs: Array of drugs involved in the combination treatment.

Example response:

{
  "indications": [
    {
      "id": "clrw9ar1w0000jq081pukhhhu",
      "kind": "Pain relief (analgesic) Fever reduction (antipyretic)",
      "offLabel": false,
      "otcUse": true,
      "route": [],
      "doseForm": [
        {
          "value": "Oral"
        },
        {
          "value": "tablet"
        }
      ],
      "doseStrength": " 500 mg for adults, 160 mg for children per tablet/syrup dose",
      "combinationType": "Single",
      "drug": {
        "tradeName": "Tylenol",
        "id": "clqjl06p4000449l7qe6kop1g"
      },
      "condition": {
        "name": "Mild to Moderate Pain, Fever",
        "id": "clqklnm4u001j49c9h2a0u05i",
        "severity": "All severities for pain and fever, as recommended",
        "status": "Active pain or fever",
        "stage": "Not specifically applicable"
      },
      "combinationDrugs": []
    }
  ]
}

Error Handling

The API returns the following HTTP status codes in case of errors:

  • 400 Bad Request: The request is invalid or missing required parameters.
  • 404 Not Found: No drug found with the provided ID.
  • 500 Internal Server Error: An error occurred on the server while processing the request.

Pagination and Filtering

This endpoint does not supports pagination for large data sets.

Filtering options are available for off_label and otc_use, attributes of the indications. These can be appended as query parameters to the URL. Certainly, here's an updated documentation snippet for the API endpoint that includes information about the filtering options for off_label and otc_use attributes of the indications:

Query Parameters for Filtering:

  • off_label: Filters the indications based on whether they are used off-label or not. Set this to true to only retrieve off-label indications.
  • otc_use: Filters the indications based on whether they are available for over-the-counter (OTC) use. Set this to true to only retrieve indications available for OTC use.

Example Usage:

To fetch indications for a drug with a specific Drug ID, with optional filtering:

curl -L 'https://www.britelink.iov1/drugs/{drugId}/indications?off_label=true&otc_use=true' \
-H 'Authorization: Bearer BRITE_API_KEY'

This will return indications that are both off-label and available for OTC use for the specified drug.

Note: The filtering parameters are optional; you can add one and omit the other. If a parameter is omitted, it defaults to false.

Security

Requests to this endpoint must include an authorization header with a valid API key.


Drugs with Similar Indications

Overview

This endpoint retrieves a list of drugs that have indications similar to a specified drug, based on the Drug ID. It's useful for understanding alternative treatments or therapies that share similar medical indications.

HTTP Request

GET https://www.britelink.io/api/v1/drugs/<ID>/similar_indications

URL Parameters

ParameterDescription
IDThe unique identifier (Drug ID) of the drug for which to retrieve drugs with similar indications.

Response Structure

The response is a JSON object containing a similar_indications key. This key maps to an array of objects, each representing a drug with similar indications to the input drug. The structure of each object in this array is as follows:

  • drug: An object containing information about the similar drug.
    • name: Name of the similar drug.
    • britelinkId: Drug ID of the similar drug.
  • from: An object describing the relationship from the input drug to the similar drug.
    • concept: An object representing a medical condition.
    • indication: An object representing the indication details.
  • to: An object describing the relationship from the similar drug to the input drug.
    • concept: An object representing a medical condition.
    • indication: An object representing the indication details.

Each indication object includes details such as kind, off_label, otc_use, route, dose_form, dose_strength, age_groups, drug, regions, condition, and other relevant information.

Example Request

curl -L 'https://www.britelink.io/api/v1/drugs/DB00675/similar_indications' \
-H 'Authorization: Bearer BRITE_API_KEY'

Example Response

{
  "similar_indications": [
    {
      "drug": {
        "name": "Tylenol",
        "britelinkId": "clqjl06p4000449l7qe6kop1g"
      },
      "from": {
        "concept": {
          "title": "Mild to Moderate Pain, Fever",
          "britelinkId": "clqklnm4u001j49c9h2a0u05i"
        },
        "indication": {
          "kind": "Pain relief (analgesic) Fever reduction (antipyretic)",
          "offLabel": false,
          "otcUse": true,
          "route": [],
          "doseForm": ["Oral", "tablet", "oral"]
        }
      },
      "to": {
        "concept": {
          "title": "Mild to Moderate Pain, Fever",
          "britelinkId": "clqklnm4u001j49c9h2a0u05i"
        },
        "indication": {
          "kind": "Pain relief (analgesic) Fever reduction (antipyretic)",
          "offLabel": false,
          "otcUse": true,
          "route": [],
          "doseForm": ["Oral", "tablet", "oral"]
        }
      }
    }
  ]
}

Usage Notes

  • This endpoint is valuable for exploring alternative drugs and understanding the breadth of treatments available for similar conditions.
  • Ensure that the DrugID provided is valid to get accurate and relevant results.
  • The response provides comprehensive details, including the relationship and conditions associated with the similar drugs, offering deep insights into potential treatment paths.

Drug-Drug Interaction (DDI)

Overview

The Drug-Drug Interaction (DDI) Endpoint delivers critical information on interactions between multiple drugs. This endpoint aids in identifying potential risks, interaction mechanisms, and necessary precautions associated with combining specific drugs.

Endpoint Specification

  • URL: https://www.britelink.io/api/v1/ddi
  • Method: GET
  • Authentication: Required (API key in the request header)

Request Structure

Headers

Header NameDescriptionExample
AuthorizationAPI key for accessBearer BRITE_API_KEY

Query Parameters

ParameterDescriptionRequiredExample
drug_IdsComma-separated list of drug identifiers (IDs)Yesid1,id2,id3

Example Request

curl -X GET 'https://www.britelink.io/api/v1/ddi?drug_Ids=firstID,secondID' \
-H 'Authorization: Bearer BRITE_API_KEY'

Response Format

{
  "interactions": [
    {
      "ingredient": { "britelinkId": "1234", "name": "DrugA" },
      "affected_ingredient": [{ "britelinkId": "5678", "name": "DrugB" }],
      "description": "Increased risk of liver damage with alcohol",
      ...
    }
  ]
}

Successful Response

  • Status Code: 200 OK
  • Content-Type: application/json
  • Response Body: JSON structure with drug interaction details.

Response Fields

Field NameDescriptionType
interactionsArray of interaction objectsArray
ingredientPrimary drug involved in the interactionObject
affected_ingredientOther drugs involved in the interactionArray
descriptionBrief description of the interactionString
severitySeverity level of the interactionString
managementRecommendations for managing the interactionString
...Additional fields as needed...

Error Response

  • 422 Unprocessable Entity: Less than two drug IDs provided.
  • 404 Not Found: No interactions found for provided drug IDs.
  • 500 Internal Server Error: Server error during request processing.

Use Cases

  • Clinical Decision Making: Assists healthcare professionals in evaluating drug compatibility.
  • Pharmaceutical Research: Facilitates research into drug interaction effects.
  • Patient Care: Supports patient safety by identifying risky drug combinations.

Notes and Limitations

  • Maximum query IDs: 40 per request.
  • Ensure up-to-date data usage as the API undergoes continuous enhancements.

Implementation Notes

  • The API expects at least two drug IDs for processing.
  • It retrieves interaction data including each drug's details, consolidating them into a structured response.

Get Drug Adverse Effects

Endpoint: GET https://www.britelink.io/api/v1/drugs/{drugId}/adverse_effects

This endpoint retrieves a list of adverse effects associated with a specific drug, identified by its unique Drug ID. The data includes details such as the route of administration, dose form, evidence type, and specific effects like incidence rates and age group applicability.

Use Cases

This endpoint is particularly useful in the following scenarios:

Medical Research and Drug Safety Analysis: Researchers and pharmacologists can use this endpoint to gather detailed information about the adverse effects of specific drugs, aiding in drug safety assessments and medical studies.

Healthcare Application Development: Developers building healthcare applications, such as Electronic Health Records (EHR) or Patient Management Systems, can integrate this endpoint to provide comprehensive drug information to healthcare providers.

Pharmacy and Prescription Services: Pharmacies and online prescription services can utilize this data to inform patients about potential side effects of medications, enhancing patient care and safety.

Patient Education and Awareness: Healthcare providers can use this information to educate patients about the potential risks and adverse effects of prescribed medications, promoting informed decision-making.

Regulatory Compliance and Reporting: safety regulations and for reporting adverse drug reactions.

HTTP Request

GET https://www.britelink.io/api/v1/drugs/{ID}/adverse_effects

Example cURL

curl -L 'https://www.britelink.io/api/v1/drugs/{drugId}/adverse_effects' \
-H 'Authorization: Bearer your_api_key'

Replace {drugId} with the actual drug ID. The Authorization header should contain a valid API key.

URL Parameters

ParameterDescription
IDThe unique identifier of the drug.

Response Format

The response is a JSON array where each object represents an adverse effect associated with the drug. The structure of each object is as follows:

[
  {
    "route": [],
    "dose_form": ["Oral", "tablet", "oral"],
    "evidence_type": [
      "Based on clinical trials",
      " post-marketing surveillance",
      " and medical literature."
    ],
    "admin": "Oral administration; adverse effects are generally dose-related and influenced by individual factors such as liver health and concurrent medication use.",
    "regions": "Global",
    "age_groups": [
      "Generally well-tolerated across all age groups. Caution advised in very young children",
      " older adults",
      " and those with liver impairment."
    ],
    "incidences": [
      {
        "kind": "warning 1",
        "percent": "67"
      }
    ],
    "effect": [
      {
        "name": "Hypersensitivity",
        "britelinkId": "clqkl5z8g001349c9y5f40lj5"
      },
      {
        "name": "Sample",
        "britelinkId": "clqkl5z8g001349c9y5f40lj5"
      }
    ]
  }
]

Error Responses

Status CodeDescription
400Bad request, such as missing or invalid drugId.
404No adverse effects found for the specified drugId.
500Internal server error.

Notes

  • Ensure the request is made with proper authorization (API key).

Get Drug Contraindications

This endpoint retrieves a list of contraindications associated with a specific drug. A contraindication is a condition or factor that serves as a reason to withhold a certain medical treatment due to the harm that it would cause the patient.

HTTP Request

GET https://www.britelink.io/api/v1/drugs/{drugId}/contraindications

URL Parameters

ParameterDescription
drugIdThe unique identifier of the drug.

Response Format

The response is a JSON array where each element represents a contraindication associated with the drug. Each contraindication includes routes, dose forms, hypersensitivity data, lab values, recommended actions, and patient conditions.

Response JSON Structure

[
  {
    "route": [String],
    "dose_form": [String],
    "hypersensitivity": [String],
    "lab_values": [String],
    "recommended_actions": String,
    "patient_conditions": [
      {
        "name": String,
        "modification_of": {
          "condition_status": String,
          "base": {
            "name": String,
            "britelinkId": String
          },
          "severity": {
            "includes": [String],
            "excludes": [String]
          }
        }
      }
    ]
  },
  ...
]

Example Request

curl -L 'https://www.britelink.io/api/v1/drugs/${drugId}/contraindications' \
-H 'Authorization: Bearer yourapikey'

Example Response

[
  {
    "route": [],
    "dose_form": [],
    "hypersensitivity": ["true"],
    "lab_values": ["Liver enzyme levels"],
    "recommended_actions": "Monitor liver function",
    "patient_conditions": [
      {
        "name": "Severe, active Liver Disease",
        "modification_of": {
          "condition_status": "active",
          "base": {
            "name": "Liver Disease",
            "britelinkId": "12345678"
          },
          "severity": {
            "includes": ["severe"],
            "excludes": []
          }
        }
      }
    ]
  }
]

Use Case

This endpoint can be primarily used by healthcare professionals and medical systems to retrieve vital contraindication information for a given drug. It helps in making informed decisions about drug prescriptions and managing patient safety by identifying conditions under which a drug should not be used.


Fetch Therapeutic Alternatives for a Drug

Overview

This API endpoint retrieves lists of drugs as therapeutic alternatives based on the provided drug’s therapeutic categorizations. Each category where the provided drug is considered therapeutic will return a separate list of drug alternatives.

HTTP Request

GET https://www.britelink.io/api/v1/drugs/<ID>/therapeutic_alternatives

URL Parameters

  • ID: The ID or equivalent unique identifier of the drug for which to retrieve the linked therapeutic alternatives.

Headers

  • Authorization: Your API key

Example Request

curl -L 'https://www.britelink.io/api/v1/drugs/DB09156/therapeutic_alternatives' \
-H 'Authorization: Bearer yourapikey'

Response Structure

The response is an array of therapeutic alternative categories. Each category includes the category details and a list of alternative drugs within that category.

JSON Response Example

[
  {
    "briteLinkId": "BR4565",
    "name": "Non-Steroidal Anti-Inflammatory Drug (NSAID)",
    "meshId": "D007052",
    "meshTreeNumbers": [
      "D02.241.223.100.085.500",
      "D02.455.426.559.389.657.239.500"
    ],
    "atcCode": "M01AE01",
    "atcLevel": null,
    "categorizationKind": "non-selective COX inhibitor",
    "synonyms": ["Advil", "Motrin", "Nurofen."],
    "description": "Used for pain relief, fever reduction, and inflammation control. It works by blocking the production of prostaglandins, substances in the body that cause pain and inflammation.",
    "drug": {
      "tradeName": "Tylenol",
      "id": "clqjl06p4000449l7qe6kop1g"
    }
  }
]

Fields

  • briteLinkId: A unique identifier for the therapeutic category.
  • name: Name of the therapeutic category.
  • meshId: Medical Subject Headings (MeSH) ID of the category.
  • meshTreeNumbers: MeSH tree numbers for the category.
  • atcCode: Anatomical Therapeutic Chemical (ATC) code.
  • atcLevel: Level of the ATC code.
  • categorizationKind: The kind of categorization (e.g., "non-selective COX inhibitor").
  • synonyms: Synonyms or alternative names for the category.
  • description: Description of the therapeutic category.
  • drug: Contains tradeName and unique id of the primary drug.

Use Cases

This endpoint is particularly useful for healthcare professionals and researchers looking for alternative medication options for a particular drug. It helps in identifying alternative treatments based on therapeutic categories.

Error Handling

Errors will be returned in the following format:

{
  "error": {
    "code": "ErrorCode",
    "message": "Error message describing what went wrong"
  }
}

Common Error Responses

  • 400 Bad Request: The request was invalid or cannot be served. This is often due to missing a required parameter.
  • 401 Unauthorized: The API key is missing or invalid.
  • 404 Not Found: The specified drug ID was not found.
  • 500 Internal Server Error: An error has occurred within the server.

Handling Errors

Clients should handle these errors gracefully, displaying relevant messages to the end-user and potentially logging error details for debugging purposes.

Indications


Fetch Indications

Overview

This endpoint retrieves indications to a condition based on specified condition name(s). This endpoint provide detailed information about the indications of various conditions, including related conditions and drug details.

HTTP Request

GET https://www.britelink.io/api/v1/indications

URL Parameters

ParameterRequiredDescription
qYesA comma-separated list of condition names .

Request Examples

Curl Example:

curl -X GET 'https://www.britelink.io/api/v1/indications?q=pain,fever' \
-H 'Authorization: Bearer BRITE_API_KEY'

Response Structure

The response consists of a JSON array where each object represents an indication, structured as follows:

  • resourceType: (String) Specifies the type of the FHIR resource, in this case, "Indications".
  • britelinkId: (String) A unique identifier for the indication.
  • kind: (String) A brief description of the type or category of the indication.
  • offLabel: (Boolean) Indicates whether the usage of the drug for this indication is off-label.
  • otcUse: (Boolean) Indicates whether the drug for this indication is available over-the-counter.
  • doseStrengths: (String) Information regarding the dosage strengths recommended for this indication.
  • combinationType: (String) The type of drug combination (if any) associated with this indication.
  • indicatedDrug: (Object) Contains details about the drug associated with the indication.
    • id: (String) The unique identifier of the drug.
    • details: (Object) Detailed information about the drug, including:
      • tradeName: (String) The trade name of the drug.
      • genericName: (String) The generic name of the drug.
      • simpleDescription: (String) A brief description of the drug, its uses, and other relevant information.
  • condition: (Object) Details about the medical condition associated with the indication.
    • britelinkId: (String) The unique identifier of the associated condition.
    • name: (String) The name of the medical condition.
    • severity: (String) The severity level of the condition.
    • status: (String) The current status of the condition.
    • stage: (String) The stage of the condition, if applicable.

Response Example

[
  {
    "resourceType": "Indications",
    "britelinkId": "clrw9ar1w0000jq081pukhhhu",
    "kind": "Pain relief (analgesic) Fever reduction (antipyretic)",
    "offLabel": false,
    "otcUse": true,
    "doseStrengths": " 500 mg for adults, 160 mg for children per tablet/syrup dose",
    "combinationType": "Single",
    "indicatedDrug": {
      "id": "clqjl06p4000449l7qe6kop1g",
      "details": {
        "tradeName": "Tylenol",
        "genericName": "Acetaminophen",
        "simpleDescription": "Tylenol, containing acetaminophen, is an analgesic and antipyretic for mild to moderate pain and fever reduction. Adult dosage: 500-1000 mg every 4-6 hours, max 4000 mg/day. Rapid GI absorption, liver metabolism, urinary excretion. Side effects: rare but may include hepatotoxicity. Use cautiously in liver impairment and avoid overdose. Antidote for overdose: N-acetylcysteine (NAC)"
      }
    },
    "condition": {
      "resourceType": "Condition",
      "britelinkId": "clqklnm4u001j49c9h2a0u05i",
      "name": "Mild to Moderate Pain, Fever",
      "severity": "All severities for pain and fever, as recommended",
      "status": "Active pain or fever",
      "stage": "Not specifically applicable"
    }
  }
]

Error Handling

  • 400 Bad Request: Returned if the 'indications' parameter is missing or empty.
  • 404 Not Found: Returned if no matching indications are found for the specified names.
  • 500 Internal Server Error: Returned if there's an error processing the request.

Usage Notes

This endpoint is useful for healthcare applications, drug information systems, and medical research platforms that require detailed information about conditions and associated indications.


Drugs By Indications

Overview

This endpoint retrieves a list of drugs based on specified conditions and their related indications. It is particularly useful for professionals seeking medication options for specific health conditions, such as arthritis, diabetes, etc.

HTTP Request

GET https://www.britelink.io/api/v1/indications/drugs

URL Parameters

  • q: (String) The text used to search conditions by name. This parameter is required.
  • more: (Boolean, optional) Determines how to broaden the condition search results. By default, it is set to false. Setting it to true will return more comprehensive results.
  • off_label: (Boolean, optional) Limits results to drugs used off-label for the specified conditions.
  • otc_use: (Boolean, optional) Filters results to drugs available over-the-counter.
  • kind: (String, optional) Specifies the kind of indication to filter the search results.

Headers

  • Authorization: Your API key is required for authorization.

Example Request

curl -L 'https://www.britelink.io/api/v1/indications/drugs?q=arthritis' \
-H 'Authorization:Bear myapikey'

Response Structure

The response is a JSON array containing drug objects. Each object includes comprehensive details about the drug, its pharmacological profile, interactions, and relevant therapeutic categories.

Sample response structure (abbreviated for brevity):

[
  {
    "id": "1234",
    "tradeName": "Drug name",
    "genericName": "Generic Name",
    "simpleDescription": "Short description",
    "chemicalStructure": "Chemical structure details",
    "pharmacology": {
      "mechanismOfAction": "Mechanism of action",
      "pharmacodynamics": "Pharmacodynamics details",
      "pharmacokinetics": "Pharmacokinetics details"
      // Additional pharmacology details
    },
    "therapeuticCategories": [
      {
        "name": "Category Name",
        "description": "Category description"
        // Other category details
      }
    ]
    // Other drug details
  }
]

Error Handling

  • 400 Bad Request: Occurs if the required parameters are not provided or malformed.
  • 401 Unauthorized: Returned if the API key is missing or invalid.
  • 404 Not Found: Returned if no drugs are found for the specified indications.
  • 500 Internal Server Error: Indicates a server-side error.

Usage Notes

  • The endpoint supports pagination for large result sets.
  • The response includes detailed drug information, making it a comprehensive resource for medical professionals and researchers.
  • The endpoint is optimized for efficient and precise retrieval of drug information based on medical conditions and indications.

Security and Privacy

  • Ensure secure storage and transmission of API keys.
  • The endpoint adheres to data privacy regulations for medical data handling.

Get Conditions

Overview

This API endpoint facilitates the searching of medical conditions. It allows for precise or broad matching of condition names, and now includes enhanced features for more flexible data retrieval and detailed information.


HTTP Request Details

  • Endpoint: GET https://www.britelink.io/api/v1/conditions

Required Headers

HeaderDescription
AuthorizationYour API key.

Query Parameters

ParameterTypeRequiredDefaultDescription
qStringNo-Text used to search conditions by name. Optional.
fuzzyBooleanNofalseEnables fuzzy search for approximate matches.
exactBooleanNofalseOnly includes exact matches to the query.
rBooleanNofalseInclude referenced drugs and indications if true.
cursorStringNo-Cursor for pagination control.

Note: The exact parameter cannot be used in conjunction with fuzzy. Doing so will result in a 400 Bad Request error. The r parameter, when set to true, enriches the response with detailed related information.

Pagination Support

  • This endpoint now supports cursor-based pagination, which is beneficial for handling extensive datasets. Default batch size is 10 conditions.

Example Usage

  • CURL Request:
    curl -L 'https://www.britelink.io/api/v1/conditions?q=Diabetes&r=true' \
    -H 'Authorization: Bearer myapikey'
    

Response Format

  • Response Structure: The response is in JSON format, comprising an array of objects. Each object represents a condition and contains the following fields:

    FieldTypeDescription
    idArrayId of the condition.
    nameStringName of the condition.
    severityStringSeverity degree of the condition.
    statusStringCondition status.
    drugIdStringId of the indicated drug for the condition.
    indicationsArrayArray of related indications (if r is true).
    drugObjectDetailed drug information (if r is true).
  • Sample Response:

    [
      {
        "id": "clqklnm4u001j49c9h2a0u05i",
        "name": "Mild to Moderate Pain, Fever",
        "severity": "All severities for pain and fever, as recommended",
        "status": "Active pain or fever",
        "stage": "Not specifically applicable",
        "drugId": "clqjl06p4000449l7qe6kop1g"
        // Additional fields if 'r' is true
      }
    ]
    

Error Handling

  • Common HTTP Status Codes:

    Status CodeMeaning
    400Bad Request – Parameter errors.
    401Unauthorized – API key issues.
    404Not Found – No matching conditions.
    500Internal Server Error.

Security and Compliance

  • API key must be transmitted securely.
  • Adheres to standard protocols for medical data privacy and security.

Notes for Developers

  • Ideal for user interfaces requiring quick search and retrieval of medical conditions.
  • Enhanced with flexible query parameters (q, r, cursor) for broad or specific searches and detailed data retrieval.
  • Supports pagination for efficient handling of large data sets.

Fetch Condition by ID

Overview

This endpoint provides detailed information about a specific medical condition by its unique identifier. It is particularly useful for healthcare applications, research, and data analysis related to medical conditions and their associated treatments.

HTTP Request

GET https://www.britelink.io/conditions/{conditionId}

URL Structure

  • Base URL: https://www.britelink.io
  • Path: /api/v1/conditions/{conditionId}
  • Method: GET

URL Parameters

  • conditionId (required): The unique identifier of the condition.

Headers

HeaderValueDescription
AuthorizationBearer BRITE_API_KEYAPI key for authorization.

Response Structure

The response will be a JSON object containing detailed information about the condition:

  • id: Unique identifier of the condition.
  • name: Name of the condition.
  • indications: Array of related indications.
  • drug: Associated drug data, if applicable.

Example Response

{
  "id": "clqklnm4u001j49c9h2a0u05i",
  "name": "Mild to Moderate Pain, Fever",
  "severity": "All severities for pain and fever, as recommended",
  "status": "Active pain or fever",
  "stage": "Not specifically applicable",
  "drugId": "clqjl06p4000449l7qe6kop1g",
  "indications": [
    {
      "id": "clrw9ar1w0000jq081pukhhhu",
      "kind": "Pain relief (analgesic) Fever reduction (antipyretic)",
      "offLabel": false,
      "otcUse": true,
      "doseStrength": " 500 mg for adults, 160 mg for children per tablet/syrup dose",
      "combinationType": "Single",
      "drugId": "clqjl06p4000449l7qe6kop1g",
      "conditionId": "clqklnm4u001j49c9h2a0u05i"
    }
  ],
  "drug": {
    "id": "clqjl06p4000449l7qe6kop1g",
    "tradeName": "Tylenol",
    "genericName": "Acetaminophen",
    "registrationNo": "123abc",
    "dateRegistered": "2023-12-25T00:00:00.000Z",

    "strength": "2mg",
    "form": "Tablet",
    "applicantName": "PharmaHealth Inc.",
    "principalName": "Active Pharmaceuticals",
    "categoryId": "clqjkjarq000049khgvkwz6gf",
    "foodInteractions": null,
    "levelOfAvailability": "A",
    "drugPriority": "N",
    "ispublished": false,
    "createdAt": "2023-12-24T14:25:24.712Z",
    "updatedAt": "2023-12-25T07:32:58.148Z"
  }
}

Response Codes

Status CodeDescription
200Success - Condition data retrieved.
400Bad Request - Missing condition ID.
404Not Found - Condition ID not found.
500Internal Server Error - Processing error.

Error Handling

  • 400 Bad Request: Returned if the conditionId is missing.
  • 404 Not Found: Occurs when no condition matches the given ID.
  • 500 Internal Server Error: Indicates server-side issues.

Usage Example

cURL Example

curl -X GET 'https://www.britelink.io/api/v1/conditions/clqklnm4u001j49c9h2a0u05i' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer BRITE_API_KEY'

Use Cases

  • Healthcare Applications: Integrating condition data into healthcare software for patient management and treatment planning.
  • Medical Research: Researchers can access detailed condition information for studies and analysis.
  • Educational Tools: Utilized in educational platforms for medical training and learning.
  • Data Analysis: Analyzing trends and patterns in condition treatments and outcomes.

Fetch Indications for a Condition

Overview

This endpoint is designed to retrieve detailed indications associated with a specified medical condition. It returns a comprehensive list of indications, including drug information, formatted according to FHIR standards.

Endpoint Details

  • HTTP Method: GET
  • Endpoint: https://www.britelink.io/api/v1/conditions/{conditionId}/indications

URL Parameters

ParameterRequiredDescription
conditionIdYesUnique identifier of the medical condition.

Request Headers

HeaderRequiredDescription
AuthorizationYesBearer BRITE_API_KEY.

Response Format

The response is a JSON array where each object represents an indication linked to the condition. The structure is compliant with the FHIR standard.

Object Structure

  • resourceType: String - The type of the FHIR resource.
  • britelinkId: String - Unique identifier of the indication.
  • kind: String - Description of the indication.
  • offLabel: Boolean - Indicates off-label use.
  • otcUse: Boolean - Over the counter availability.
  • doseStrengths: String - Dosage strength details.
  • combinationType: String - Type of combination for the drug.
  • indicatedDrug: Object - Drug details including:
    • id: String - Drug identifier.
    • details: Object - Drug information like trade name, generic name, and description.

Example Usage

Here's how to use this endpoint in a JavaScript function:

async function fetchIndicationsForCondition(conditionId) {
  const response = await fetch(
    `https://www.britelink.io/api/v1/conditions/${conditionId}/indications`,
    {
      method: "GET",
      headers: {
        Authorization: `Bearer ${apiKey}`,
      },
    }
  );

  if (!response.ok) {
    throw new Error("Error fetching indications");
  }

  return await response.json();
}

CURL Example

curl -L 'https://www.britelink.io/api/v1/conditions/{conditionId}/indications' \
-H 'Authorization: Bearer BRITE_API_KEY'

Sample Response

[
  {
    "resourceType": "Indications",
    "britelinkId": "clrw9ar1w0000jq081pukhhhu",
    "kind": "Pain relief (analgesic) Fever reduction (antipyretic)",
    "offLabel": false,
    "otcUse": true,
    "doseStrengths": "500 mg for adults, 160 mg for children per tablet/syrup dose",
    "combinationType": "Single",
    "indicatedDrug": {
      "id": "clqjl06p4000449l7qe6kop1g",
      "details": {
        "tradeName": "Tylenol",
        "genericName": "Acetaminophen",
        "simpleDescription": "Tylenol, an analgesic and antipyretic."
      }
    }
  }
]

Error Handling

  • 400 Bad Request: Indicates missing or incorrect conditionId.
  • 404 Not Found: No indications found for the given condition ID.
  • 500 Internal Server Error: Server-related errors.

Use Cases

  • Ideal for healthcare applications needing condition-specific medication data.
  • Can be utilized in patient education platforms to provide detailed drug information.
  • Useful for clinicians seeking information for treatment planning.

Version and Updates

  • Current Version: 1.0
  • Last Updated: [Date]
  • Change Log:
    • Initial release with indication fetching capabilities.

Fetch Drugs Linked to a Condition via Indications

Endpoint Overview

This API endpoint retrieves detailed information about drugs linked to a specific condition through indications. The data is formatted according to the FHIR standard and includes comprehensive pharmacological details, chemical structure, interactions, and more.

HTTP Request

GET https://www.britelink.io/api/v1/conditions/{conditionId}/indications/drugs

Required Headers

HeaderDescription
AuthorizationBearer BRITE_API_KEY.

URL Parameters

ParameterDescription
conditionIdUnique identifier of the condition. Required.

Response Structure

The response is a JSON array of objects. Each object represents a drug and includes:

FieldDescription
idUnique identifier of the drug.
tradeNameTrade name of the drug.
genericNameGeneric name of the drug.
simpleDescriptionBrief description of the drug.
Additional fieldsIncluding pharmacology, interactions, and more.

Example Response

[
  {
    "drug": {
      "id": "clqjl06p4000449l7qe6kop1g",
      "tradeName": "Tylenol",
      "genericName": "Acetaminophen",
      "simpleDescription": "Tylenol, containing acetaminophen..."
      // Additional fields...
    }
  }
  // Additional drugs...
]

Error Handling

Status CodeDescription
200Request successful.
400Bad request, often due to missing parameters.
404No drugs found for the specified condition ID.
500Internal server error.

Use Cases

  • Clinical decision support for selecting appropriate drug options.
  • Providing healthcare professionals with detailed drug information.
  • Integration of drug data into healthcare and pharmaceutical applications.

Sample JavaScript Fetch Request

fetch(
  "https://www.britelink.io/api/v1/conditions/{conditionId}/indications/drugs",
  {
    method: "GET",
    headers: {
            Authorization: `Bearer ${apiKey}`,,
    },
  }
)
  .then((response) => response.json())
  .then((data) => console.log(data))
  .catch((error) => console.error("Error:", error));

Security and Authentication

A valid API key is required for authentication, passed in the Authorization header. Ensure secure handling and storage of your API key.


Endpoint Documentation: Fetch Allergies

Overview

This endpoint retrieves a comprehensive list of allergy records from the database, formatted in accordance with the FHIR (Fast Healthcare Interoperability Resources) standard for the AllergyIntolerance resource. It primarily serves healthcare applications by providing detailed allergy information, including associated drug details.

HTTP Request

GET /api/v1/allergies

Required Headers

HeaderDescription
AuthorizationBearer BRITE_API_KEY
Content-Typeapplication/json

Query Parameters

ParameterRequiredTypeDescription
None--No query parameters required

Response Structure

The response is a JSON array of objects, each structured as an AllergyIntolerance resource.

FieldTypeDescription
resourceTypeStringAlways "AllergyIntolerance".
idStringUnique identifier for the allergy record.
clinicalStatusStringClinical status of the allergy (e.g., "active").
verificationStatusStringVerification status (e.g., "unconfirmed").
typeStringType of record, typically "allergy".
categoryArrayCategories of the allergy (e.g., ["medication"]).
criticalityStringCriticality level (e.g., "low").
codeObjectContains textual description of the allergy.
patientObjectPatient details (if available).
onsetDateTimeStringDate-time when allergy first observed.
recordedDateStringDate when allergy was recorded.
reactionArrayList of reactions related to the allergy.
drugObjectDrug details associated with the allergy (if any).

Error Handling

Status CodeDescription
404No allergy records found.
500Internal server error or issue fetching data.

Example Request

curl -X GET "https://www.britelink.io/api/allergies" -H "Authorization: Bearer BRITE_API_KEY" -H "Content-Type: application/json"

Example Response

[
  {
    "resourceType": "AllergyIntolerance",
    "id": "allergy123",
    "clinicalStatus": "active",
    ... // Additional details
  }
  // ... more allergy records
]

Use Cases

  • Patient Health Records Management: Integrates with health record systems to manage patient allergy information.
  • Clinical Decision Support: Provides healthcare providers with crucial allergy data for informed decision-making.
  • Patient Safety: Identifies potential allergens, particularly critical in medication prescriptions.

Fetch Allergies Linked to a Specific Drug Endpoint

Overview

This endpoint retrieves a list of allergies associated with a given drug, identified by its trade name or generic name. It is designed to aid healthcare providers in checking for potential allergic reactions when prescribing medication.

HTTP Request

GET https://www.britelink.io/api/v1/allergies

Headers

HeaderValueDescription
AuthorizationBearer BRITE_API_KEYThe API key for authorization.

Query Parameters

ParameterRequiredDescription
qYesThe trade name or generic name of the drug.

Response

The response is a JSON array of allergy objects formatted according to FHIR standards. Each object includes details of the allergy, cross-sensitivity, sensitive drugs, incidence rate, and the associated drug details.

Response Object

FieldTypeDescription
resourceTypeStringThe type of the FHIR resource, e.g., "AllergyIntolerance".
idStringThe unique identifier of the allergy.
clinicalStatusStringThe clinical status of the allergy.
verificationStatusStringVerification status of the allergy report.
typeStringThe type of the allergy, e.g., "allergy".
categoryArrayCategories of the allergy, e.g., ["medication"].
criticalityStringThe criticality of the allergic reaction.
codeObjectAn object containing the textual description of the allergy.
drugObjectAn object containing details of the associated drug.

Sample Response

[
  {
    "resourceType": "AllergyIntolerance",
    "id": "clqkksrze000d49c995nezd51",
    "clinicalStatus": "active",
    "verificationStatus": "unconfirmed",
    "type": "allergy",
    "category": ["medication"],
    "criticality": "low",
    "code": {
      "text": "Symptoms may include rash, swelling, itching, difficulty breathing, and severe dizziness. Anaphylaxis, a severe allergic reaction, is extremely rare."
    },
    "drug": {
      "id": "clqjl06p4000449l7qe6kop1g",
      "tradeName": "Tylenol",
      "genericName": "Acetaminophen"
    }
  }
]

Error Responses

Status CodeMessageDescription
400Search query is requiredThe trade name or generic name was not provided in the query parameter.
404No allergies found for the specified drugNo allergy records found for the given drug.
500An error occurred while fetching allergiesServer error or database connection issue.

Use Cases

  • Healthcare providers can use this endpoint to quickly identify potential allergic reactions to prescribed medications.
  • Pharmacists can verify allergy information for dispensing purposes.
  • Patients can use this to inform healthcare providers of known allergies.

Make sure to replace BRITE_API_KEY with the actual API key provided for authorization. The documentation can be further customized to include more details specific to your API's implementation and usage.

Fetch Allergy by ID

Endpoint Description

Retrieves detailed information about a specific allergy, including related drug details, by the allergy's unique identifier.

HTTP Method: GET

https://www.britelink.io/api/v1/allergies/{allergyId}

URL Parameters

  • allergyId (required): The unique identifier for the allergy.

Headers

  • Authorization: Bearer BRITE_API_KEY (required) - The API key for authentication.

Request Example

GET /api/v1/allergies/clqkksrze000d49c995nezd51
Authorization: Bearer BRITE_API_KEY

Successful Response

HTTP Status Code: 200 OK

Response Body Structure

{
  "resourceType": "Allergy",
  "id": "string",
  "description": "string",
  "crossSensitivity": "string",
  "sensitiveDrugs": "string",
  "incidenceRate": "string",
  "drug": {
    "id": "string",
    "tradeName": "string",
    "genericName": "string",
    "description": "string",
    "simpleDescription": "string",
    "clinicalDescription": "string",
    "strength": "string",
    "form": "string",
    "registrationNo": "string",
    "dateRegistered": "datetime",
    "applicantName": "string",
    "principalName": "string",
    "foodInteractions": "string",
    "levelOfAvailability": "string",
    "drugPriority": "string",
    "ispublished": "boolean",
    "createdAt": "datetime",
    "updatedAt": "datetime"
  }
}

Example Response

{
    "resourceType": "Allergy",
    "id": "clqkksrze000d49c995nezd51",
    "description": "Symptoms may include rash, swelling, itching, difficulty breathing, and severe dizziness. Anaphylaxis, a severe allergic reaction, is extremely rare.",
    "crossSensitivity": "minimal cross-sensitivity",
    "sensitiveDrugs": "caution is advised",
    "incidenceRate": "0.00",
    "drug": {
        "id": "clqjl06p4000449l7qe6kop1g",
        "tradeName": "Tylenol",
        "genericName": "Acetaminophen",
        ...
    }
}

Error Responses

  • HTTP Status Code: 400 Bad Request

    • Condition: Allergy ID is missing or invalid.
    • Response: "Allergy ID is required in the request URL"
  • HTTP Status Code: 404 Not Found

    • Condition: No allergy found for the given ID.
    • Response: "No allergy found with the provided ID"
  • HTTP Status Code: 500 Internal Server Error

    • Condition: An error occurred on the server while processing the request.
    • Response: "An error occurred while fetching the allergy"

Usage Notes

  • Ensure that the allergyId is valid and corresponds to an existing allergy record.
  • The Authorization header must contain a valid BRITE_API_KEY to access the endpoint.
  • This endpoint is intended for use by healthcare professionals and authorized personnel.

Fetch Categories

Overview

The fetchCategories endpoint retrieves a list of medication categories, including associated drugs, formatted according to the FHIR (Fast Healthcare Interoperability Resources) standards for MedicationKnowledge.

HTTP Request

GET /api/v1/categories

Headers

Header NameValueDescription
Content-Typeapplication/jsonIndicates the media type of the resource
AuthorizationBearer {API_KEY}(Optional) Authorization token if endpoint is secured

Query Parameters

This endpoint does not require any query parameters.

Request Example

GET /api/v1/categories HTTP/1.1
Host: {baseURL}
Content-Type: application/json
Authorization: Bearer {API_KEY}

Success Response

Code

200 OK

Content

An array of MedicationKnowledge resources representing medication categories.

[
  {
    "resourceType": "MedicationKnowledge",
    "id": "category-id",
    "code": {
      "coding": [
        {
          "system": "http://terminology.hl7.org/CodeSystem/ATC",
          "code": "ATC-code",
          "display": "Category Name"
        }
      ],
      "text": "Category Description"
    },
    "medicineClassification": {
      "type": {
        "coding": [
          {
            "system": "http://terminology.hl7.org/CodeSystem/medication-category",
            "code": "atc-level",
            "display": "Categorization Kind"
          }
        ],
        "text": "Synonyms"
      },
      "classification": [
        {
          "coding": [
            {
              "system": "http://hl7.org/fhir/sid/ndc",
              "code": "registration-number",
              "display": "Drug Trade Name"
            }
          ],
          "text": "Simple Drug Description"
        }
      ]
    },
    "relatedMedicationKnowledge": [
      {
        "type": "has-equivalent",
        "reference": {
          "reference": "Medication/drug-id"
        }
      }
    ]
  }
]

Error Responses

CodeContentDescription
404{"message": "No categories found"}No categories were found in the database.
500{"message": "An error occurred while fetching categories"}There was an error on the server while processing the request.

Example

Below is an example of a fetchCategories function implementation in Next.js:

// Next.js API route
export async function fetchCategories(req: NextRequest) {
  // ... existing implementation ...
}

Notes

  • Ensure the base URL is configured correctly in your environment when making the request.
  • If the API requires authorization, the API_KEY must be provided in the Authorization header.
  • The response adheres to the FHIR standard for MedicationKnowledge resources, ensuring interoperability with other FHIR-compliant systems.
  • This endpoint is read-only and does not support modifications to the medication categories or drugs.

Category Retrieval by ID, ATC Code, or MeSH ID


Endpoint Overview

This API endpoint allows for the retrieval of medication category information based on a unique identifier, which can be a category ID, an ATC (Anatomical Therapeutic Chemical) code, or a MeSH (Medical Subject Headings) ID.


Endpoint Details

DescriptionDetails
URLhttps://www.britelink.io/api/v1/categories/{codeId}
MethodGET
AuthorizationBearer Token (if required)

URL Parameter

ParameterDescriptionExample
codeIdA unique identifier that can be a category ID, ATC code, or MeSH ID.clqjkjarq000049khgvkwz6gf, N02BA, MESH12345

Request Headers

HeaderValueDescription
Content-Typeapplication/jsonIndicates the media type of the resource
AuthorizationBearer <API_KEY>API key for access (if authentication is required)

Example Requests

  1. Fetch by Category ID:
    https://www.britelink.io/api/v1/categories/clqjkjarq000049khgvkwz6gf

  2. Fetch by ATC Code:
    https://www.britelink.io/api/v1/categories/atc/N02BA

  3. Fetch by MeSH ID:
    https://www.britelink.io/api/v1/categories/mesh/MESH12345


Expected Responses

  • Success Response:

    • Code: 200 OK
    • Content: JSON object with category details.
  • Error Response:

    • Code: 404 Not Found
    • Content: {"message": "No category found with the provided code"}

Response Structure

{
  "id": "string",
  "name": "string",
  "meshId": "string",
  "atcCode": "string",
  ...
  "drugs": [
    ...
  ]
}

Implementation Notes

  • Ensure that the API correctly differentiates between Category ID, ATC code, or MeSH ID.
  • Implement robust error handling for non-existent identifiers.
  • Include authentication mechanisms where necessary.
  • The endpoint should be designed to handle high-traffic scenarios with efficient database queries.

Versioning

  • Documentation Version: 1.1
  • Last Updated: [Insert Date]

Fetch Drugs in a Given Category

Endpoint Overview

This endpoint retrieves a list of drugs associated with a specific category ID in the database. It is designed to help users access detailed information about drugs under a particular medication category.

HTTP Request

GET https://www.britelink.ios/api/v1/categories/{categoryId}/drugs

URL Parameters

ParameterRequiredDescription
categoryIdYesThe unique identifier of the category.

Headers

HeaderValue
Content-Typeapplication/json
AuthorizationBearer YOUR_API_KEY (if authentication is required)

Responses

Success Response

Code: 200 OK

Content example for a successful response:

[
  {
    "id": "drugId123",
    "tradeName": "DrugName",
    "genericName": "GenericDrugName",
    "categoryId": "categoryId123"
    // Additional drug details...
  }
  // More drugs...
]

Error Responses

Code: 400 Bad Request

Content: {"error": "Category ID is required in the request URL"}

Code: 404 Not Found

Content: {"error": "No drugs found in the specified category"}

Code: 500 Internal Server Error

Content: {"error": "An error occurred while fetching drugs"}

Example Request

Fetching drugs in the 'Pain Relievers' category:

GET /api/v1/categories/clqjkjarq000049khgvkwz6gf/drugs
Host: www.britelink.io
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

Notes

  • Ensure your API key (if required) is included in the header for authentication.
  • The endpoint will return an array of drug objects, each containing detailed information about the drug.
  • The structure of the drug object in the response will depend on the database schema and the selected fields in the query.

All Categories

Overview

This endpoint retrieves a list of categories. It supports pagination, allowing clients to fetch categories in batches. It's suitable for applications that require detailed information about drug categories, particularly in pharmaceutical or healthcare contexts.

Authentication

To access the endpoint, use the Authorization: Bearer BRITE_API_KEY header. Replace BRITE_API_KEY with your actual API key.

HTTP Request

GET https://www.britelink.io/api/v1/categories

Query Parameters

ParameterDescriptionRequiredType
cComma-separated list of category names to filter by.NoString
rSet to true to include related drugs in the response.NoBoolean
cursorCursor for pagination. Use the nextCursor value from a previous response to fetch the next batch of results.NoString

Pagination

The endpoint returns a maximum of 25 categories per request. To navigate through more categories, use the cursor parameter with the nextCursor value provided in the response.

Responses

  • HTTP 200: Successful response with categories.
  • HTTP 404: No categories found for the given filters.
  • HTTP 500: Server error.

Sample cURL Request

curl -X GET 'https://www.britelink.io/api/v1/categories?c=Antiviral&cursor=YourCursor' \
-H 'Authorization: Bearer BRITE_API_KEY'

Sample Response

{
  "categories": [
    {
      "id": "clqjkjarq000249kh4w254b4l",
      "name": "Antiviral Medications",
      "meshId": "MESH67890",
      "meshTreeNumbers": "J01CR3",
      "atcCode": "J05AB",
      "atcLevel": 3,
      "categorizationKind": "Medical",
      "synonyms": "Anti-Virals",
      "description": "Medications for viral infections"
    }
  ],
  "nextCursor": null
}

Sample Use Case with Axios

This endpoint is ideal for developers building healthcare applications that need to categorize medications or provide detailed information on different categories of drugs.

import axios from "axios";

const fetchCategories = async (cursor) => {
  try {
    const response = await axios.get(
      "https://www.britelink.io/api/v1/categories",
      {
        headers: {
          Authorization: `Bearer ${apiKey}`,
        },
        params: {
          c: "Antiviral",
          cursor: cursor,
        },
      }
    );
    console.log(response.data);
  } catch (error) {
    console.error(error);
  }
};

fetchCategories(); // Call this function with the nextCursor value to paginate

Notes

  • Replace BRITE_API_KEY with your actual API key for authentication.
  • The JavaScript example uses Axios for making HTTP requests, a popular choice in many web and Node.js applications.

Risks

Overview

This endpoint retrieves a list of risk factors associated with medications from the database. This endpoint is particularly useful for applications in healthcare and pharmaceutical sectors, providing critical information about potential risks related to drug usage.

Authentication

To access the endpoint, use the Authorization: Bearer YOUR_API_KEY header. Replace YOUR_API_KEY with your actual API key.

HTTP Request

GET https://www.britelink.io/api/v1/risks

Query Parameters

ParameterDescriptionRequiredType
nComma-separated list of risk factor names to filter by.NoString
rSet to true to include related boxed warnings in the response.NoBoolean
cursorCursor for pagination. Use the nextCursor from a previous response to fetch the next batch of results.NoString

Pagination

This endpoint supports cursor-based pagination and returns up to 25 risk factors per request. Use the cursor parameter with the nextCursor value from a previous response to navigate through more records.

Responses

  • HTTP 200: Successful response with a list of risk factors.
  • HTTP 404: No risk factors found for the given filters.
  • HTTP 500: Server error due to internal issues.

Sample Response

{
  "riskFactors": [
    {
      "id": "clr7vaaxr000s49i1g5swrqla",
      "name": "Increased Blood Pressure",
      // Other risk factor details
      "boxedWarnings": [] // List of boxed warnings if 'r' is true
    }
    // Additional risk factors
  ],
  "nextCursor": "ENCODED_CURSOR_STRING"
}

Notes

  • Ensure that the API key is provided in the request header for authorization.
  • If the r parameter is set to true, the response includes detailed boxed warnings associated with each risk factor.
  • If there are more risk factors than the batch limit, the nextCursor provides the starting point for the next set of data.
  • The response format adheres strictly to the JSON standard.

Error Handling

  • The endpoint is designed to handle and report errors effectively. In case of a server error, a 500 status code is returned with an appropriate message.
  • If no matching risk factors are found, a 404 status code is returned, indicating the absence of data based on the applied filters.

Search Adverse Effects

Overview

The fetchAdverseEffects endpoint retrieves a list of adverse effects associated with drugs. This endpoint is designed to be flexible, allowing users to either fetch all available adverse effects or to search for adverse effects related to specific medical conditions.

HTTP Request

GET https://www.britelink.io]/api/adverse-effects

Query Parameters

ParameterRequiredDescription
qNoA search string used to filter adverse effects by matching condition names. If omitted, all adverse effects are returned.

Usage

Fetching All Adverse Effects

To retrieve a complete list of all adverse effects without any filtering, simply make a request to the endpoint without any query parameters:

curl -L 'https://www.britelink.io/api/adverse-effects' \
-H 'Authorization: Bearer your-api-key'

Searching Adverse Effects by Condition Name

To search for adverse effects related to specific conditions, include the q query parameter followed by the search term(s). The search is not case-sensitive and will match any part of the condition name.

For example, to search for adverse effects related to conditions that contain the word "pain":

curl -L 'https://www.britelink.io/api/adverse-effects?q=pain' \
-H 'Authorization: your-api-key'

This request will return adverse effects for conditions like "Mild to Moderate Pain, Fever" or "Chronic Pain".

Response Format

The response is a JSON array containing objects that represent the adverse effects. Each object includes details about the drug, incidences, and effects.

Example response (truncated for brevity):

[
  {
    "drug": {
      "name": "DrugName",
      "id": "DrugID"
      // Other drug details
    },
    "incidences": [
      // Incidences data
    ],
    "effects": [
      // Effects data
    ]
    // Other adverse effect details
  }
  // Additional adverse effects
]

Notes

  • The search functionality of the endpoint is designed to be flexible, allowing partial matches for condition names.
  • The endpoint includes handling for potential errors such as database access issues, ensuring that appropriate HTTP status codes and messages are returned.

Fetch Adverse by ID

Overview

This endpoint provides detailed information about a specific medical adverse by its unique identifier. It is particularly useful for healthcare applications, research, and data analysis related to medical adverses and their associated treatments.

HTTP Request

GET https://www.britelink.io/api/v1/adverses/{adverseId}

URL Structure

  • Base URL: https://www.britelink.io
  • Path: /api/v1/adverse_effects/{adverseId}
  • Method: GET

URL Parameters

  • adverseId (required): The unique identifier of the adverse.

Headers

HeaderValueDescription
AuthorizationBearer BRITE_API_KEYAPI key for authorization.

Response Structure

Example Response

{
  "id": "clqkl5z8g001349c9y5f40lj5",
  "description": " Nausea, rash, headache.  Allergic reactions, skin reddening, blisters. Liver damage (especially with overdose or in combination with alcohol), anaphylaxis, severe skin reactions.",
  "incidenceRate": " Varies, but generally low. Less Common Effects: Rare (exact rates vary). Rare Effects: Very rare, often associated with overdose or specific health conditions.",
  "evidenceType": "Based on clinical trials, post-marketing surveillance, and medical literature.",
  "admin": "Oral administration; adverse effects are generally dose-related and influenced by individual factors such as liver health and concurrent medication use.",
  "regions": "Global",
  "ageGroups": "Generally well-tolerated across all age groups. Caution advised in very young children, older adults, and those with liver impairment.",
  "drugId": "clqjl06p4000449l7qe6kop1g",
  "effects": [
    {
      "id": "clqkn8scv002749c9zja7nmai",
      "name": "Hypersensitivity",
      "description": "no data",
      "adverseEffectId": "clqkl5z8g001349c9y5f40lj5"
    },
    {
      "id": "clqv3v5di000349i5iakl8ngw",
      "name": "Sample",
      "description": "Q.NITP.F107.V6 – Guild ITP National Assignment One: MCQ Summary – Student Copy – January 2023",
      "adverseEffectId": "clqkl5z8g001349c9y5f40lj5"
    },
    {
      "id": "clqxjrklf000649rvh21hi0uy",
      "name": "Chemistry",
      "description": "Black and White ",
      "adverseEffectId": "clqkl5z8g001349c9y5f40lj5"
    }
  ],
  "drug": {
    "id": "clqjl06p4000449l7qe6kop1g",
    "tradeName": "Tylenol",
    "genericName": "Acetaminophen",
    "registrationNo": "123abc",
    "dateRegistered": "2023-12-25T00:00:00.000Z",
    "strength": "2mg",
    "form": "Tablet",
    "applicantName": "PharmaHealth Inc.",
    "principalName": "Active Pharmaceuticals",
    "categoryId": "clqjkjarq000049khgvkwz6gf",
    "foodInteractions": null,
    "levelOfAvailability": "A",
    "drugPriority": "N",
    "ispublished": false,
    "createdAt": "2023-12-24T14:25:24.712Z",
    "updatedAt": "2023-12-25T07:32:58.148Z"
  }
}

Response Codes

Status CodeDescription
200Success - Adverse data retrieved.
400Bad Request - Missing adverse ID.
404Not Found - Adverse ID not found.
500Internal Server Error - Processing error.

Error Handling

  • 400 Bad Request: Returned if the adverseId is missing.
  • 404 Not Found: Occurs when no adverse matches the given ID.
  • 500 Internal Server Error: Indicates server-side issues.

Usage Example

cURL Example

curl -X GET 'https://www.britelink.io/api/v1/adverse_effects/clqklnm4u001j49c9h2a0u05i' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer BRITE_API_KEY'

Use Cases

  • Healthcare Applications: Integrating adverse data into healthcare software for patient management and treatment planning.
  • Medical Research: Researchers can access detailed adverse information for studies and analysis.
  • Educational Tools: Utilized in educational platforms for medical training and learning.
  • Data Analysis: Analyzing trends and patterns in adverse treatments and outcomes.

Drugs Linked To Adverse EffectCondition

Overview

The fetchDrugsLinkedToAdverseEffectCondition endpoint retrieves a list of drugs that are linked to a specific adverse effect condition. This is useful for understanding the pharmacological landscape surrounding a particular adverse effect.

HTTP Request

GET https://www.britelink.io/api/adverse_effects/{ID}/drugs

URL Parameters

ParameterDescription
IDThe unique identifier of the adverse effect condition.

Usage

Fetching Drugs Linked to an Adverse Effect Condition

To retrieve drugs related to a specific adverse effect condition, include the condition's ID in the URL. The ID should correspond to an adverse effect condition in your database.

Example request:

curl -L 'https://www.britelink.io/api/adverse_effects/{adverseEffectConditionId}/drugs' \
-H 'Authorization: Bearer your-api-key'

Replace {adverseEffectConditionId} with the actual ID of the adverse effect condition.

Response Format

The response is a JSON array of objects, where each object represents a drug linked to the specified adverse effect condition. The information is formatted according to the FHIR (Fast Healthcare Interoperability Resources) standard.

Example response (truncated for brevity):

[
  {
    "resourceType": "Drug",
    "britelinkId": "DrugID",
    "tradeName": "DrugTradeName",
    "genericName": "DrugGenericName",
    "simpleDescription": "DrugSimpleDescription"
    // Additional drug-related details
  }
  // Additional drugs
]

Error Handling

The endpoint provides clear error messages and appropriate HTTP status codes for various error conditions, such as:

  • 400 Bad Request: Returned if the adverse effect condition ID is not provided in the URL.
  • 404 Not Found: Returned if no drugs are found linked to the specified adverse effect condition ID.
  • 500 Internal Server Error: Returned in case of an error during data retrieval from the database.

Notes

  • The endpoint is designed to be robust and efficient, handling large datasets and returning results quickly.
  • Ensure that the API key used for authorization is kept secure and not exposed in client-side code.

Get Boxed Warnings of A Drug

HTTP Method: GET

URL: https://www.britelink.io/api/v1/drugs/{drugId}/warnings

This endpoint retrieves all boxed warnings associated with a specific drug, identified by its unique drug ID.

URL Parameters:

  • drugId: The unique identifier of the drug for which boxed warnings are to be retrieved.

Response Structure:

The response is a JSON array where each element represents a boxed warning associated with the drug. Each warning contains the following fields:

  • kind: The type or category of the warning.
  • recommendation: Recommended actions or precautions.
  • lab_values: List of lab values relevant to the warning (if any).
  • route: List of routes of administration related to the warning (if any).
  • dose_form: List of dose forms related to the warning (if any).
  • risk: An object containing information about the risk factor associated with the warning, including:
    • name: Name of the risk factor.
    • briteLinkId: Drug identifier for the risk factor.
    • meddra_id: Medical Dictionary for Regulatory Activities (MedDRA) identifier.
    • snomed_id: SNOMED Clinical Terms (CT) identifier.
    • icd10_id: International Classification of Diseases (ICD-10) identifier.

Request Example:

curl -X GET 'https://www.britelink.io/api/v1/drugs/{drugId}/warnings' \
-H 'Authorization: Bearer {apikey}'

Response Example:

[
  {
    "kind": "Hepatotoxicity",
    "recommendation": "Monitor liver function regularly",
    "lab_values": [],
    "route": [],
    "dose_form": [],
    "risk": {
      "name": "Liver Failure",
      "drugbank_id": "BAP0031848",
      "meddra_id": "pt/10019663",
      "snomed_id": "c/235883002",
      "icd10_id": "c/K72.9"
    }
  }
  // Additional warnings...
]

Use Case

Who Should Use This Endpoint:

  • Healthcare professionals seeking detailed warning information for specific medications.
  • Pharmacists verifying boxed warnings for prescription drugs.
  • Medical researchers analyzing drug safety profiles.
  • Health applications integrating drug safety data.

Applicable Scenarios:

  • A pharmacist wants to inform a patient about the potential risks and safety precautions associated with a prescribed medication.
  • A healthcare provider is reviewing a patient's medication regimen and needs to be aware of any severe warnings for each drug.
  • A medical research project requires the collection of boxed warning data for a set of drugs for analysis.

Packages for a Drug

Notice: THIS ENDPOINT IS AVAILABLE UPON REQUEST.

HTTP Method: GET URL: https://www.britelink.io/api/v1/drugs/{drugId}/packages

This endpoint retrieves detailed package information for a specific drug, identified by its unique ID. The information includes package codes, descriptions, quantities, and associated product details. The data is specific to the Zimbabwean (MCAZ) jurisdiction.

URL Parameters:

  • drugId: The ID of the drug for which package information is to be retrieved.

Response Structure:

The response is a JSON array where each element represents a package associated with the drug. Each package contains the following fields:

  • package_ndc_code: The National Drug Code (NDC) for the package.
  • originator_package_ndc_code: The NDC code of the originator package.
  • description: Brief description of the package contents.
  • full_description: Full description of the package contents.
  • amount: Quantity of contents in the package.
  • unit: Unit of measurement for the amount.
  • form: Form of the package (e.g., bottle).
  • product: An object containing information about the associated product, including:
    • ndc_product_code: NDC product code.
    • name: Name of the product.

Request Example:

curl -L 'https://www.britelink.io/api/v1/drugs/${drugId}/packages' \
-H 'Authorization: Bearer myapikey'

Response Example:

[
  {
    "package_ndc_code": "16590-0023-90",
    "originator_package_ndc_code": "16590-023-90",
    "description": "90 TABLET IN 1 BOTTLE",
    "full_description": "90 TABLET IN 1 BOTTLE",
    "amount": "90",
    "unit": "1",
    "form": "BOTTLE",
    "product": {
      "ndc_product_code": "16590-0023",
      "name": "ACETAMINOPHEN AND CODEINe"
    }
  }
  // Additional packages...
]

Use Case

Who Should Use This Endpoint:

  • Pharmacists and pharmacy technicians for inventory management and drug dispensing.
  • Healthcare providers for prescribing information and patient counseling.
  • Pharmaceutical companies for market research and competitive analysis.
  • Health informatics systems integrating drug package data.

Drug Labels

Notice: THIS ENDPOINT IS AVAILABLE UPON REQUEST.

Fetch Current MCAZ Labels for a Drug

HTTP Method: GET

URL: https://www.britelink.io/api/v1/drugs/{drugId}/labels

Description: This endpoint provides a list of the current MCAZ labels available for a specific drug, based on its ID. These labels offer crucial information, including the label ID, set ID, version, and other details. This data is specific to the U.S. jurisdiction.

URL Parameters:

  • drugId: The DrugBank ID of the drug for which FDA label information is being requested.

Response Structure:

The response is a JSON array, with each element representing an MCAZ label. Each label includes the following fields:

  • id: Unique identifier for the label.
  • set_id: Identifier for the set of labels.
  • version: Version number of the label.
  • current: Boolean indicating whether the label is the current version.
  • title: Title of the label.
  • product_type: Type of product associated with the label.
  • effective_on: Date when the label became effective.
  • labeler_name: Name of the entity that labeled the product.
  • first_product_marketing_started_on: Date when the product marketing started.
  • last_product_marketing_ended_on: Date when the product marketing ended (if applicable).
  • ndc_product_codes: Array of NDC product codes related to the label.
  • pmg_section_count, hpi_section_count, sli_section_count, all_section_count: Counts of various sections within the label.

Request Example:

curl -L 'https://www.britelink.io/api/v1/drugs/${DrugId}/labels' \
-H 'Authorization: Bearer myapikey'

Response Example:

[
  {
    "id": "e9be0ef0-4032-4c3b-e053-2995a90adf25",
    "set_id": "a35079fa-b693-45e8-9715-488e33e7c1a9",
    "version": 5,
    "current": true,
    "title": "Lisinopril - Lisinopril TABLET",
    "product_type": "HUMAN PRESCRIPTION DRUG LABEL",
    "effective_on": "2022-09-28",
    "labeler_name": "REMEDYREPACK INC.",
    "first_product_marketing_started_on": "2020-02-01",
    "last_product_marketing_ended_on": null,
    "ndc_product_codes": ["70518-2561"]
    // Additional sections...
  }
  // Additional labels...
]

Use Case

Who Should Use This Endpoint:

  • Healthcare professionals seeking detailed labeling information on prescription drugs.
  • Pharmacists verifying label information for dispensing accuracy.
  • Regulatory compliance teams in pharmaceutical companies.
  • Medical researchers and students studying drug labeling standards and practices.

Chemistry API

Overview

The Chemistry API provides access to a rich dataset of chemical properties associated with various drugs. With support for fuzzy and exact match searches, pagination, conditional detail inclusion, and sorting, this API offers flexibility and efficiency for applications ranging from pharmaceutical research to drug development.

Endpoint

GET https://www.britelink.io/api/v1/chemistry

Authorization Header

To access the API, include an authorization header with your request:

HeaderValue
AuthorizationBearer YOUR_API_KEY

Replace YOUR_API_KEY with the API key you receive upon registration or from your API management dashboard.

Making a Request

Example Request using cURL

curl -X GET "https://www.britelink.io/api/v1/chemistry" \
     -H "Authorization: Bearer YOUR_API_KEY"

Example Request using JavaScript

const apiKey = "YOUR_API_KEY"; // Replace with your API key
const apiUrl = "https://www.britelink.io/api/v1/chemistry";

fetch(apiUrl, {
  method: "GET",
  headers: {
    Authorization: `Bearer ${apiKey}`,
  },
})
  .then((response) => response.json())
  .then((data) => console.log(data))
  .catch((error) => console.error("Error:", error));

Request Parameters

Customize your query with the following parameters:

ParameterTypeDescriptionRequired
cursorstringCursor for pagination, indicating the starting point for the next batch of results.No
bintegerBatch size for pagination, up to a maximum of 250. Default is 25.No
nstringThe name of the drug to search for, supporting fuzzy and exact matches.No

Responses

  • HTTP 200: Success, returns a list of chemistries.
  • HTTP 404: No matching chemistries found.
  • HTTP 500: Internal server error.

Response Format

Responses are structured as JSON, providing chemistries grouped by drugs, with pagination support through nextCursor.

{
  "chemistries": [
    {
      "drugName": "Denileukin diftitox",
      "properties": [
        {
          "kind": "Molecular Formula",
          "value": "C2560H4042N678O799S17"
        },
        {
          "kind": "Melting Point",
          "value": "71 °C (whole mAb)"
        }
        // Additional properties...
      ]
    }
    // Additional drugs with properties...
  ],
  "nextCursor": "nextCursorString"
}

Use Cases

  • Pharmaceutical Research: Access detailed chemical properties of drugs for research and development purposes.
  • Drug Discovery: Utilize chemical data to identify potential drug candidates and assess their properties.
  • Pharmacological Studies: Incorporate chemistry information into pharmacological studies for a better understanding of drug mechanisms and effects.
  • Clinical Trials: Enhance clinical trial design by considering the chemical characteristics of drugs under investigation.

Best Practices

  • Use pagination to handle large datasets efficiently, ensuring optimal performance and resource utilization.
  • Leverage fuzzy search for flexible querying, allowing users to find chemistries even with partial or similar drug names.
  • Implement error handling to gracefully manage situations where no chemistries match the specified criteria.

Get Chemistry data by ID

Overview

The Chemistry by ID endpoint allows users to retrieve detailed information about a specific chemistry based on its unique identifier (ID). This endpoint provides access to essential details of the chemistry, including its kind, value, associated drug ID, and the name of the drug it belongs to.

Endpoint

GET https://www.britelink.io/api/v1/chemistry/{chemistryId}

Authorization Header

To access the endpoint, include an authorization header with your request:

HeaderValue
AuthorizationBearer YOUR_API_KEY

Replace YOUR_API_KEY with the API key you receive upon registration or from your API management dashboard.

Making a Request

Example Request using cURL

curl -X GET "https://www.britelink.io/api/v1/chemistry/{chemistryId}" \
     -H "Authorization: Bearer YOUR_API_KEY"

Example Request using JavaScript

const apiKey = "YOUR_API_KEY"; // Replace with your API key
const apiUrl = "https://www.britelink.io/api/v1/chemistry/{chemistryId}";

fetch(apiUrl, {
  method: "GET",
  headers: {
    Authorization: `Bearer ${apiKey}`,
  },
})
  .then((response) => response.json())
  .then((data) => console.log(data))
  .catch((error) => console.error("Error:", error));

Request Parameters

This endpoint does not accept query parameters. The chemistry ID is extracted from the URL path.

Responses

  • HTTP 200: Success, returns detailed information about the chemistry.
  • HTTP 404: Chemistry not found.
  • HTTP 500: Internal server error.

Response Format

The response is structured as JSON and includes the following information:

  • id: Unique identifier of the chemistry.
  • kind: Type or category of the chemistry.
  • value: Value or measurement associated with the chemistry.
  • drugId: Unique identifier of the drug associated with the chemistry.
  • drugName: Name of the drug associated with the chemistry.

Example Response

{
  "id": "clsq7tyws007mgw4p4fz19w7b",
  "kind": "Hydrophobicity",
  "value": "-0.192",
  "drugId": "clslvdmpp000y1gmwz3e7tckd",
  "drugName": "Paracetamol"
}

Use Cases

  • Research and Development: Retrieve detailed chemistry information for pharmaceutical research and development projects.
  • Clinical Trials: Access chemistry data to support the analysis of drug properties and interactions during clinical trials.
  • Medical Education: Utilize chemistry details for educational purposes in medical training programs and courses.

Best Practices

  • Ensure the provided chemistry ID is valid and corresponds to an existing chemistry record.
  • Handle potential errors such as 404 (Chemistry not found) gracefully in your application logic.

Chemical Structures

Overview

The Chemical Structure API provides access to chemical structures associated with drugs. It supports searching for chemical structures by drug name, fetching a list of chemical structures, and retrieving detailed information about each chemical structure.

Endpoint

GET https://www.britelink.io/api/v1/structures

Authorization Header

To access the API, include an authorization header with your request:

HeaderValue
AuthorizationBearer YOUR_API_KEY

Replace YOUR_API_KEY with the API key you receive upon registration or from your API management dashboard.

Making a Request

Example Request using cURL

curl -X GET "https://www.britelink.io/api/v1/structures" \
     -H "Authorization: Bearer YOUR_API_KEY"

Example Request using JavaScript

const apiKey = "YOUR_API_KEY"; // Replace with your API key
const apiUrl = "https://www.britelink.io/api/v1/structures";

fetch(apiUrl, {
  method: "GET",
  headers: {
    Authorization: `Bearer ${apiKey}`,
  },
})
  .then((response) => response.json())
  .then((data) => console.log(data))
  .catch((error) => console.error("Error:", error));

Request Parameters

Customize your query with the following parameters:

ParameterTypeDescriptionRequired
nstringThe drug name to search for chemical structures. Supports fuzzy search.No
bintegerBatch size for pagination, up to a maximum of 500. Default is 250.No
cursorstringCursor for pagination, indicating the starting point for the next batch of results.No

Responses

  • HTTP 200: Success, returns a list of chemical structures.
  • HTTP 404: No matching chemical structures found.
  • HTTP 500: Internal server error.

Response Format

Responses are structured as JSON, providing a list of chemical structures grouped by drug name.

{
  "chemicalStructures": [
    {
      "drugName": "Acarbose",
      "drugId": "clrn36iud0012jr08bn6mg4ho",
      "structures": [
        {
          "id": "clsn4rx2d00f7p8eza7xgkwxa",
          "name": "(2R,3R,4R,5R)-4-{[(2R,3R,4R,5S,6R)-5-{[(2R,3R,4S,5S,6R)-3,4-dihydroxy-6-methyl-5-{[(1S,4R,5S,6S)-4,5,6-trihydroxy-3-(hydroxymethyl)cyclohex-2-en-1-yl]amino}oxan-2-yl]oxy}-3,4-dihydroxy-6-(hydroxymethyl)oxan-2-yl]oxy}-2,3,5,6-tetrahydroxyhexanal",
          "formula": "C25H43NO18",
          "molecularWeight": 645.608,
          "casNumber": "56180-94-0"
        }
      ]
    },
    {
      "drugName": "Acarbose",
      "drugId": "clslvmdto003m13zpoq5en5n4",
      "structures": []
    }
  ]
}

Use Cases

  • Pharmaceutical Research: Access detailed chemical structure information for drug development and analysis.
  • Chemistry Education: Provide students and researchers with comprehensive chemical structure data for educational purposes.
  • Drug Discovery: Utilize chemical structure data to identify potential drug candidates and study their properties.

Best Practices

  • Use the n parameter for efficient searching of chemical structures by drug name, supporting fuzzy search for better results.
  • Employ pagination with the b and cursor parameters for handling large datasets and optimizing performance.
  • Ensure proper authentication by including the authorization header with your API key in each request.

Chemical Structure by ID

Overview

The Chemical Structure by ID API provides access to detailed information about a specific chemical structure identified by its unique ID. Users can retrieve information such as the name, formula, molecular weight, CAS number, and associated drug for the given chemical structure.

Endpoint

GET https://www.britelink.io/api/v1/chemical-structures/{chemicalStructureId}

Authorization Header

To access the API, include an authorization header with your request:

HeaderValue
AuthorizationBearer YOUR_API_KEY

Replace YOUR_API_KEY with the API key you receive upon registration or from your API management dashboard.

Making a Request

Example Request using cURL

curl -X GET "https://www.britelink.io/api/v1/chemical-structures/{chemicalStructureId}" \
     -H "Authorization: Bearer YOUR_API_KEY"

Example Request using JavaScript

const apiKey = "YOUR_API_KEY"; // Replace with your API key
const chemicalStructureId = "YOUR_CHEMICAL_STRUCTURE_ID"; // Replace with the desired chemical structure ID
const apiUrl = `https://www.britelink.io/api/v1/chemical-structures/${chemicalStructureId}`;

fetch(apiUrl, {
  method: "GET",
  headers: {
    Authorization: `Bearer ${apiKey}`,
  },
})
  .then((response) => response.json())
  .then((data) => console.log(data))
  .catch((error) => console.error("Error:", error));

Path Parameters

ParameterDescription
chemicalStructureIdThe unique ID of the chemical structure.

Responses

  • HTTP 200: Success, returns detailed information about the chemical structure.
  • HTTP 404: Chemical structure not found.
  • HTTP 500: Internal server error.

Response Format

Responses are structured as JSON, providing detailed information about the chemical structure, including its name, formula, molecular weight, CAS number, and associated drug.

{
  "id": "YOUR_CHEMICAL_STRUCTURE_ID",
  "name": "(2R,3R,4R,5R)-4-{[(2R,3R,4R,5S,6R)-5-{[(2R,3R,4S,5S,6R)-3,4-dihydroxy-6-methyl-5-{[(1S,4R,5S,6S)-4,5,6-trihydroxy-3-(hydroxymethyl)cyclohex-2-en-1-yl]amino}oxan-2-yl]oxy}-3,4-dihydroxy-6-(hydroxymethyl)oxan-2-yl]oxy}-2,3,5,6-tetrahydroxyhexanal",
  "formula": "C25H43NO18",
  "molecularWeight": 645.608,
  "casNumber": "56180-94-0",
  "createdAt": "TIMESTAMP",
  "updatedAt": "TIMESTAMP",
  "drug": {
    "id": "YOUR_DRUG_ID",
    "tradeName": "Trade Name",
    "genericName": "Generic Name",
    "simpleDescription": "Brief description of the drug"
  }
}

Use Cases

  • Pharmaceutical Research: Retrieve detailed chemical structure information for drug development and analysis.
  • Chemistry Education: Access comprehensive chemical structure data for educational purposes and research.
  • Drug Discovery: Utilize chemical structure data to study the properties and characteristics of drugs and their components.

Best Practices

  • Ensure proper authentication by including the authorization header with your API key in each request.
  • Handle potential errors such as 404 (not found) and 500 (internal server error) gracefully in your application logic.

Classification of Drugs

Overview

The Classification API provides access to a comprehensive dataset of chemical classifications associated with various drugs. This API supports fuzzy and exact match searches, pagination, conditional detail inclusion, and sorting, offering flexibility and efficiency for applications in pharmaceutical research, drug development, and related fields.

Endpoint

GET https://www.britelink.io/api/v1/classifications

Authorization Header

To access the API, include an authorization header with your request:

HeaderValue
AuthorizationBearer YOUR_API_KEY

Replace YOUR_API_KEY with the API key you receive upon registration or from your API management dashboard.

Making a Request

Example Request using cURL
curl -X GET "https://www.britelink.io/api/v1/classifications" \
     -H "Authorization: Bearer YOUR_API_KEY"
Example Request using JavaScript
const apiKey = "YOUR_API_KEY"; // Replace with your API key
const apiUrl = "https:///www.britelink.io/api/v1/classifications";

fetch(apiUrl, {
  method: "GET",
  headers: {
    Authorization: `Bearer ${apiKey}`,
  },
})
  .then((response) => response.json())
  .then((data) => console.log(data))
  .catch((error) => console.error("Error:", error));

Request Parameters

Customize your query with the following parameters:

ParameterTypeDescriptionRequired
cursorstringCursor for pagination, indicating the starting point for the next batch of results.No
bintegerBatch size for pagination, up to a maximum of 250. Default is 25.No
nstringThe name of the drug to search for, supporting fuzzy and exact matches.No
rbooleanSpecify if related fields should be included (default: false).No
kstringFilter classifications by kingdom.No
sstringFilter classifications by superclass.No
cstringFilter classifications by class.No
scstringFilter classifications by subclass.No

Responses

  • HTTP 200: Success, returns a list of classifications.
  • HTTP 404: No matching classifications found.
  • HTTP 500: Internal server error.

Response Format

Responses are structured as JSON, providing an array of classifications grouped by drugs, with pagination support through nextCursor.

{
  "classifications": [
    {
      "id": "clsr6c07e17p7xej5zvuztsx6",
      "description": "This compound belongs to the class of organic compounds known as dimethoxybenzenes. These are organic aromatic compounds containing a monocyclic benzene moiety carrying exactly two methoxy groups.",
      "directParent": "Dimethoxybenzenes",
      "kingdom": "Organic compounds",
      "superclass": "Benzenoids",
      "class": "Benzene and substituted derivatives",
      "subclass": "Methoxybenzenes",
      "drugs": [
        {
          "id": "clslvydmx00d313zpjs4l48k4",
          "tradeName": "Methoxamine",
          "genericName": "Methoxamine"
        }
      ]
    }
  ],
  "nextCursor": "nextCursorString"
}

Use Cases

Pharmaceutical Research: Access detailed chemical classifications of drugs for research and development.

  • Drug Discovery: Utilize chemical classification data to identify potential drug candidates and assess their properties.
  • Pharmacological Studies: Incorporate chemical classification information into pharmacological studies for a better understanding of drug mechanisms.
  • Clinical Trials: Enhance clinical trial design by considering the chemical classifications of drugs under investigation.
  • Toxicity Assessment: Assess the toxicity of drugs based on their chemical classifications to mitigate potential adverse effects.

Best Practices

  • Use pagination to handle large datasets efficiently, ensuring optimal performance and resource utilization.
  • Leverage fuzzy search for flexible querying, allowing users to find classifications even with partial or similar drug names.
  • Implement error handling to gracefully manage situations where no classifications match the specified criteria.

Drug Classifications by ID

This endpoint retrieves a specific classification based on the provided classification ID.

Request Parameters

  • r (optional): Indicates whether to include related data, such as alternative parents, substituents, and drugs.

Example Request

GET /api/v1/classifications/abcdef1234567890?r=true HTTP/1.1
Host: www.britelink.io

Response

  • 200 OK: Returns the classification with the specified ID.
  • 404 Not Found: If no classification is found with the provided ID.
  • 500 Internal Server Error: If an error occurs while fetching the classification.

Response Format

{
  "id": "abcdef1234567890",
  "description": "This compound belongs to the class of organic compounds known as dimethoxybenzenes.",
  "directParent": "Dimethoxybenzenes",
  "kingdom": "Organic compounds",
  "superclass": "Benzenoids",
  "class": "Benzene and substituted derivatives",
  "subclass": "Methoxybenzenes",
  "drugs": [
    {
      "id": "clslvydmx00d313zpjs4l48k4",
      "tradeName": "Methoxamine",
      "genericName": "Methoxamine"
    }
  ]
}

Use Cases

  • Data Retrieval: Retrieve detailed information about a specific chemical classification.
  • Integration: Integrate classification data into various applications, such as research tools or educational platforms.
  • Quality Assurance: Validate the accuracy and completeness of classification data to ensure data quality.
  • Data Analysis: Analyze classification data to identify patterns or relationships between drugs and chemical properties.
  • Research: Support scientific research by providing access to detailed chemical classification information for analysis and experimentation.

Endpoint URL: https://www.britelink.io/api/v1/classifications/${classificationId}

Dosages API

Overview

The Dosages API allows users to access dosage information associated with various drugs.

Endpoint

GET https://www.britelink.io/dosages

Making a Request

Example Request using cURL

curl -X GET "https://www.britelink.io/dosages"

Example Request using JavaScript

const apiUrl = "https://www.britelink.io/dosages";

fetch(`${apiUrl}`)
  .then((response) => response.json())
  .then((data) => console.log(data))
  .catch((error) => console.error("Error:", error));

Request Parameters

Customize your query with the following parameters:

ParameterTypeDescriptionRequired
nstringThe name of the drug to search for dosages.Yes
cursorstringCursor for pagination of results.No
bintegerBatch size for pagination (default: 250, max: 500).No

Responses

  • HTTP 200: Success, returns a list of dosages.
  • HTTP 404: No matching dosages found.
  • HTTP 500: Internal server error.

Response Format

Responses are structured as JSON, providing dosages grouped by drugs, with pagination support through nextCursor.

{
  "dosages": [
    {
      "drugName": "Aspirin",
      "dosages": [
        {
          "form": "Tablet",
          "physicalForm": "Oral Tablet",
          "adminMethod": "Oral",
          "strength": "500mg",
          "id": "clrn5m01o0026ia08lou1bb1g"
        },
        {
          "form": "Capsule",
          "physicalForm": "Capsule",
          "adminMethod": "Oral",
          "strength": "200mg",
          "id": "clrn5m01o0026ia08lou1bb1h"
        }
      ]
    }
    // Additional drugs with dosages...
  ],
  "nextCursor": "nextCursorString"
}

Use Cases

  • Clinical Practice: Healthcare professionals can access accurate dosage information to prescribe medications effectively and ensure patient safety.
  • Patient Education: Patients can learn about their prescribed medications, including dosage instructions and administration methods, to adhere to their treatment plans properly.
  • Pharmaceutical Research: Researchers can analyze dosage patterns and formulations across different drugs to identify trends, optimize drug delivery methods, and develop new formulations.
  • Pharmacovigilance: Pharmacovigilance teams can use dosage data to monitor and analyze adverse drug reactions and medication errors, contributing to drug safety assessments and regulatory reporting.

Dosage by ID Endpoint

Overview

The Dosage by ID endpoint allows users to retrieve detailed information about a specific dosage by providing its unique identifier (ID).

Endpoint

GET https://www.britelink.io/dosages/:id

Replace :id with the ID of the dosage you want to retrieve.

Making a Request

Example Request using cURL

curl -X GET "https://www.britelink.io/dosages/clrn5m01o0026ia08lou1bb1g"

Example Request using JavaScript

const dosageId = "clrn5m01o0026ia08lou1bb1g";
const apiUrl = `https://www.britelink.io/dosages/${dosageId}`;

fetch(apiUrl)
  .then((response) => response.json())
  .then((data) => console.log(data))
  .catch((error) => console.error("Error:", error));

Responses

  • HTTP 200: Success, returns detailed information about the dosage.
  • HTTP 404: No dosage found with the specified ID.
  • HTTP 500: Internal server error.

Response Format

Responses are structured as JSON, providing detailed information about the dosage.

{
  "drugName": "Aspirin",
  "dosage": {
    "form": "Tablet",
    "physicalForm": "Oral Tablet",
    "adminMethod": "Oral",
    "strength": "500mg",
    "id": "clrn5m01o0026ia08lou1bb1g"
  }
}

Use Cases

  • Dosage Verification: Healthcare professionals can verify dosage details before prescribing medications to patients.
  • Patient Education: Patients can access detailed information about their prescribed dosages to ensure proper medication adherence and understand potential side effects.
  • Research and Analysis: Researchers can analyze individual dosages to study drug formulations, dosing regimens, and their effects on patient outcomes.

Best Practices

  • Ensure that the dosage ID provided in the request is valid and corresponds to an existing dosage record.
  • Handle errors gracefully by providing informative error messages in the response for better usability and troubleshooting.

Food Interactions API

Overview

The Food Interactions API provides access to information about interactions between drugs and food items. It offers functionalities for searching food interactions based on drug names, pagination, and error handling. This API is valuable for applications in the healthcare industry, pharmaceutical research, and patient education.

Endpoint

GET https://www.britelink.io/api/v1/food_interactions

Authorization Header

Include an authorization header with your request:

HeaderValue
AuthorizationBearer YOUR_API_KEY

Replace YOUR_API_KEY with your API key obtained upon registration or from your API management dashboard.

Making a Request

Example Request using cURL

curl -X GET "https://www.britelink.io/api/v1/food_interactions" \
     -H "Authorization: Bearer YOUR_API_KEY"

Example Request using JavaScript

const apiKey = "YOUR_API_KEY"; // Replace with your API key
const apiUrl = "https://www.britelink.io/api/v1/food_interactions";

fetch(apiUrl, {
  method: "GET",
  headers: {
    Authorization: `Bearer ${apiKey}`,
  },
})
  .then((response) => response.json())
  .then((data) => console.log(data))
  .catch((error) => console.error("Error:", error));

Request Parameters

Customize your query with the following parameters:

ParameterTypeDescriptionRequired
cursorstringCursor for pagination, indicating the starting point for the next batch of results.No
bintegerBatch size for pagination, up to a maximum of 250. Default is 25.No
nstringThe name of the drug to search for food interactions. Supports fuzzy and exact matches.No

Responses

  • HTTP 200: Success, returns a list of food interactions.
  • HTTP 404: No matching food interactions found.
  • HTTP 500: Internal server error.

Response Format

Responses are structured as JSON, providing food interactions grouped by drugs, with pagination support through nextCursor.

{
  "foodInteractions": [
    {
      "drugName": "Aspirin",
      "interactions": [
        {
          "id": "abc123",
          "advice": "Avoid taking aspirin with large quantities of alcohol to reduce the risk of gastrointestinal bleeding."
        },
        {
          "id": "def456",
          "advice": "Consume aspirin with food to minimize stomach irritation."
        }
        // Additional interactions...
      ]
    }
    // Additional drugs with interactions...
  ],
  "nextCursor": "nextCursorString"
}

Use Cases

  • Clinical Practice: Provide healthcare professionals with information about potential interactions between drugs and food, aiding in treatment decisions and patient counseling.
  • Patient Education: Empower patients to make informed choices about their medication regimen by understanding how food can impact drug effectiveness and safety.
  • Pharmaceutical Research: Incorporate knowledge about food interactions into drug development processes to optimize drug formulations and dosing recommendations.
  • Healthcare Information Systems: Integrate food interaction data into electronic health records (EHRs) and clinical decision support systems to enhance medication management and patient safety.

Best Practices

  • Use pagination to manage large datasets efficiently, ensuring smooth retrieval of food interaction information.
  • Support fuzzy search to accommodate variations in drug names and improve the user experience.
  • Implement robust error handling to gracefully manage situations where no food interactions match the specified criteria.

Get Food Interaction Data by ID

Overview

The Food Interaction by ID endpoint enables users to fetch detailed information about a specific food interaction based on its unique identifier (ID). This endpoint provides access to essential details of the food interaction, including advice, associated drug ID, and the name of the drug it belongs to.

Endpoint

GET https://www.britelink.io/api/v1/food_interactions/{foodInteractionId}

Authorization Header

To access the endpoint, include an authorization header with your request:

HeaderValue
AuthorizationBearer YOUR_API_KEY

Replace YOUR_API_KEY with the API key you receive upon registration or from your API management dashboard.

Making a Request

Example Request using cURL

curl -X GET "https://www.britelink.io/api/v1/food_interactions/{foodInteractionId}" \
     -H "Authorization: Bearer YOUR_API_KEY"

Example Request using JavaScript

const apiKey = "YOUR_API_KEY"; // Replace with your API key
const apiUrl =
  "https://www.britelink.io/api/v1/food_interactions/{foodInteractionId}";

fetch(apiUrl, {
  method: "GET",
  headers: {
    Authorization: `Bearer ${apiKey}`,
  },
})
  .then((response) => response.json())
  .then((data) => console.log(data))
  .catch((error) => console.error("Error:", error));

Request Parameters

This endpoint does not accept query parameters. The food interaction ID is extracted from the URL path.

Responses

  • HTTP 200: Success, returns detailed information about the food interaction.
  • HTTP 404: Food interaction not found.
  • HTTP 500: Internal server error.

Response Format

The response is structured as JSON and includes the following information:

  • id: Unique identifier of the food interaction.
  • advice: Advice or guidance related to the food interaction.
  • drugId: Unique identifier of the drug associated with the food interaction.
  • drugName: Name of the drug associated with the food interaction.

Example Response

{
  "id": "clt89kbzr0002m7yxc49ng8gc",
  "advice": "Avoid consumption of grapefruit while taking this medication.",
  "drugId": "clslvdmpp000y1gmwz3e7tckd",
  "drugName": "Paracetamol"
}

Use Cases

  • Medical Counseling: Provide patients with specific advice regarding dietary restrictions based on drug-food interactions.
  • Drug Interaction Management: Support healthcare professionals in managing drug therapy by considering potential food interactions.
  • Patient Education: Educate patients about the impact of certain foods on medication effectiveness and safety.

Best Practices

  • Verify the correctness of the provided food interaction ID to ensure retrieval of accurate information.
  • Handle potential errors such as 404 (Food interaction not found) gracefully in your application logic.

Disease API

Overview

The Disease API provides comprehensive access to a vast dataset of over 10,000 diseases, supporting the health tech community in building more informed and efficient systems. With capabilities for both fuzzy and exact match searches, pagination, conditional detail inclusion, and sorting, this API is designed to serve a wide range of applications, from diagnostic tools to educational platforms.

For Definitions see API dictionary

Endpoint

GET https://www.britelink.io/api/v1/diseases

Authorization Header

To access the API, include an authorization header with your request:

HeaderValue
AuthorizationBearer YOUR_API_KEY

Replace YOUR_API_KEY with the API key you receive upon registration or from your API management dashboard.

Making a Request

Example Request using cURL

curl -X GET "https://www.britelink.io/api/v1/diseases" \
     -H "Authorization: Bearer YOUR_API_KEY"

Example Request using JavaScript

const apiKey = "YOUR_API_KEY"; // Replace with your API key
const apiUrl = "https://www.britelink.io/api/v1/diseases";

fetch(apiUrl, {
  method: "GET",
  headers: {
    Authorization: `Bearer ${apiKey}`,
  },
})
  .then((response) => response.json())
  .then((data) => console.log(data))
  .catch((error) => console.error("Error:", error));

Request Parameters

Customize your query with the following parameters:

ParameterTypeDescriptionRequired
nstringThe disease name to search for, supporting both fuzzy and exact matches.No
ebooleanIf true, performs an exact match search. Default is fuzzy search.No
rbooleanInclude detailed references (true) or just disease names (false). Default is true.No
sbooleanEnable alphabetical sorting of disease names (true). Default is false.No
sOrderstringSort order: asc for ascending, desc for descending. Default is asc.No
bintegerBatch size for pagination, up to a maximum of 250. Default is 25.No
cursorstringCursor for pagination, indicating the starting point for the next batch of results.No

Responses

  • HTTP 200: Success, returns a list of diseases.
  • HTTP 404: No matching diseases found.
  • HTTP 500: Internal server error.

Response Format

Responses are structured as JSON, providing either basic or detailed information per the r parameter, along with pagination support through nextCursor.

Basic Information Response

{
  "diseases": [
    {
      "Disease_Name": "Acute Radiation Syndrome"
      // Additional entries...
    }
  ],
  "nextCursor": "nextCursorString"
}

Detailed Information Response (When r=true)

{
  "diseases": [
    {
      "id": "1",
      "Disease_Name": "Acute Radiation Syndrome",
      "Disease_ID": "ARS123",
      "Alternative_Disease_IDs": "ARS321",
      "Definition": "A condition caused by exposure to a high dose of radiation...",
      "Parent_IDs": "PARENT123",
      "Tree_Numbers": "TREE123",
      "Parent_Tree_Numbers": "PARENT_TREE123",
      "Synonyms": ["Radiation Sickness", "Radiation Poisoning"],
      "Slim_Mappings": ["Mapping1", "Mapping2"]
      // Additional details...
    }
    // Additional disease entries...
  ],
  "nextCursor": "nextCursorString"
}

Use Cases

  • Medical Research Platforms: Enhance research tools with detailed disease data, supporting studies on prevalence, treatment efficacy, and epidemiological trends.
  • Healthcare Applications: Integrate disease information to support diagnostic accuracy, patient education, and treatment planning.
  • Public Health Informatics: Use the API to track disease trends, inform public health strategies, and educate the public on health risks and preventions.
  • Educational Tools: Incorporate detailed disease information into learning resources for medical students and professionals.

Best Practices

  • Utilize URL encoding for the n parameter to handle spaces or special characters.
  • Employ the nextCursor for efficient pagination, facilitating access to large datasets without performance compromise. See more on pagination

Labs API

Endpoint

GET https://www.britelink.io/api/v1/labs

This endpoint retrieves a list of laboratory tests based on search criteria, including test names or category/subcategory names. It supports pagination and conditional inclusion of detailed fields.

To ensure secure access to the endpoint, authentication is required. Use the following HTTP header for your requests:

Authorization Header

HeaderValue
AuthorizationBearer YOUR_API_KEY

Replace YOUR_API_KEY with your actual API key provided upon registration or through your API management dashboard.

Example Request using cURL

Here is a sample cURL command to access the fetchLabs endpoint, including how to include the authorization header:

curl -X GET "https://britelink.io/api/v1/labs" \
     -H "Authorization: Bearer YOUR_API_KEY" \

Example Request using JavaScript

Below is an example JavaScript snippet using the Fetch API to make a request to the labs endpoint. It demonstrates how to include the authorization header:

const apiKey = "YOUR_API_KEY"; // Replace with your actual API key
const apiUrl = "https://britelink.io/api/v1/labs";

fetch(apiUrl, {
  method: "GET",
  headers: {
    Authorization: `Bearer ${apiKey}`,
  },
})
  .then((response) => response.json())
  .then((data) => console.log(data))
  .catch((error) => console.error("Error:", error));

Request Parameters

ParameterTypeDescriptionRequired
nstringA comma-separated list of names to search for, matching either test names or category names.No
rbooleanIf true, includes all related fields in the test model. If false, returns basic test info.No
cursorstringA cursor for pagination, indicating the starting point for the next batch of results.No

Responses

  • HTTP 200: Successful response with a list of risk factors.
  • HTTP 404: No risk factors found for the given filters.
  • HTTP 500: Server error due to internal issues.

Response Format

The response is a JSON object containing an array of tests, each with basic or detailed information based on the r parameter, and a cursor for fetching the next page of results.

Basic Information Response

{
  "tests": [
    {
      "id": "1",
      "name": "Complete Blood Count",
      "normalRange": "4,500 to 10,000 cells per microliter",
      "units": "cells per microliter",
      "categoryName": "Hematology",
      "subCategoryName": "General Hematology"
    }
    // Additional test entries...
  ],
  "nextCursor": "cursorString"
}

Detailed Information Response (When r=true)

{
  "tests": [
    {
      "id": "1",
      "name": "Complete Blood Count",
      "normalRange": "4,500 to 10,000 cells per microliter",
      "units": "cells per microliter",
      "categoryName": "Hematology",
      "subCategoryName": "General Hematology",
      "description": "A test to evaluate your overall health...",
      "methodology": "Automated cell counter",
      "duration": "24 hours",
      "testResults": [
        /* Array of test result objects */
      ]
    }
    // Additional test entries...
  ],
  "nextCursor": "cursorString"
}

Use Cases

Clinical Decision Support Systems

Clinical decision support systems (CDSS) can use this endpoint to fetch relevant tests for specific conditions or symptoms entered by healthcare professionals. For example, entering "anemia" could return tests like "Complete Blood Count" under the "Hematology" category.

Electronic Health Records (EHR) Systems

EHR systems can integrate this endpoint to provide doctors with quick access to test information during patient consultations, helping them order the most appropriate tests based on the patient's symptoms or medical history.

Laboratory Information Systems (LIS)

LIS can utilize this API to help lab technicians verify test orders, understand test specifications, or find related tests for comparative analysis. This is especially useful in cases where specific tests require understanding of normal ranges, units, or methodologies.

Health Information Websites

Websites providing health information can use this endpoint to display detailed information about various laboratory tests, including their normal ranges, methodologies, and what they are typically used for, enhancing the content provided to their users.

Notes

  • Ensure URL encoding of the n parameter when searching for names with spaces or special characters.
  • The nextCursor should be used as is for pagination without any modifications or decoding.
  • The detailed response structure may vary based on the actual database schema and the implementation details of the db module.

Appointment Scheduling API

Introduction

This guide is designed to provide developers with detailed information on integrating and managing appointment scheduling within healthcare applications. Our API offers a comprehensive suite of endpoints to manage appointments, coordinate with healthcare providers, and handle patient data efficiently.

The BriteLink Appointment Scheduling API facilitates seamless interactions between different components of healthcare systems, enabling effective management of provider schedules, patient appointments, and related operations. By leveraging our API, developers can create robust applications that help healthcare facilities optimize their workflows, reduce administrative burdens, and improve patient care services.

Key Features

  • Appointment Management: Create, update, retrieve, and delete appointments with ease.
  • Provider and Patient Integration: Link appointments directly to specific healthcare providers and patients for better coordination.
  • Real-time Scheduling: Access real-time availability and scheduling capabilities to ensure up-to-date appointment booking.
  • Security and Compliance: Adhere to strict security protocols and compliance standards to protect sensitive healthcare information.

Getting Started

Before you can begin using the BriteLink API, you need to obtain credentials that will allow you to make requests to the API endpoints. Follow the steps below to get started:

  1. Create an Account: Register for an account at BriteLink Registration.
  2. Generate API Key: Once registered, navigate to your dashboard and generate API keys that you will use to authenticate requests.

Authentication

All API requests must be authenticated using an API key sent in the request header. Here is an example of how to include your API key in your requests:

GET /api/v1/premises HTTP/1.1
Host: britelink.io
Authorization: Bearer YOUR_API_KEY_HERE

Base URL

The Base URL for all API requests is https://britelink.io/api/v1/.

API Endpoints Overview

This API is structured into distinct endpoints, each designed to facilitate seamless interactions across the healthcare booking system. By integrating the Premises, Providers, Patients, and Appointments endpoints, developers can harness the full potential of a connected and interoperable healthcare ecosystem. This integrated approach not only simplifies the management of healthcare data but also enhances the functionality and user experience of your application. Additionally, developers are provided with the flexibility to either utilize BriteLink’s robust internal database for data management or opt for their own external databases. This choice allows for greater control over data storage solutions, enabling developers to align the API integration with their specific security standards, performance requirements, and scalability needs.

Using the useInternalDb Parameter

Many of the methods provided by the BriteAPI SDK include an optional parameter called useInternalDb. This parameter allows developers to specify whether they want to utilize BriteLink's internal database for data management operations. By default, this parameter is set to false, meaning that the SDK will use the default database configured for the API.

Why Use useInternalDb?

  • Flexibility: Developers can choose to use BriteLink's internal database or their own external databases based on their specific requirements.
  • Performance: Leveraging BriteLink's internal database can often lead to faster data retrieval and processing, especially for applications with large datasets.
  • Security: BriteLink's internal database is designed to adhere to strict security protocols and compliance standards, ensuring the safety and integrity of healthcare data.

Example Usage

// Create a new appointment using BriteLink's internal database
const newAppointment = {
  date: "2024-05-15",
  providerId: 123,
  patientId: 456,
  // Other appointment details...
};
const createdAppointment = await briteAPI.createAppointment(
  newAppointment,
  true
);

In the example above, the createAppointment method is called with the useInternalDb parameter set to true, indicating that BriteLink's internal database should be used for the operation.


Building a Healthcare Booking App with Next.js and BriteLink 's Appointment Scheduling API

Introduction

This tutorial will guide you through building a healthcare booking application using Next.js, leveraging the BriteLink API. By integrating endpoints for premises, providers, patients, and appointments, you'll create a highly interoperable system that can either directly interact with BriteLink's internal database or cache data locally.

Prerequisites

  • Basic knowledge of JavaScript and React
  • Familiarity with Next.js framework
  • Node.js and npm installed
  • Access to BriteLink API and valid API key

Setting Up Your Project

  1. Create a Next.js App: Start by creating a new Next.js application if you haven't already:
  1. Install Required Packages:
npm install briteapi --save
  1. Environment Setup: Configure your API keys securely:

    echo "NEXT_PUBLIC_API_URL=https://britelink.io/api/v1" >> .env.local
    echo "API_KEY=your_api_key_here" >> .env.local
    

make sure you have installed the briteapi package in your Next.js project:

Then, you can create a page component in your Next.js project to fetch and display appointments:

// app/page.js

import React, { useState, useEffect } from "react";
import { BriteAPI } from "briteapi";

const AppointmentsPage = () => {
  const [appointments, setAppointments] = useState([]);
  const [loading, setLoading] = useState(true);
  const [error, setError] = useState(null);

  useEffect(() => {
    const fetchAppointments = async () => {
      try {
        const briteAPI = new BriteAPI("your_api_key_here");
        const fetchedAppointments = await briteAPI.fetchAppointments();
        setAppointments(fetchedAppointments);
        setLoading(false);
      } catch (error) {
        setError(error);
        setLoading(false);
      }
    };

    fetchAppointments();
  }, []);

  return (
    <div>
      <h1>Appointments</h1>
      {loading ? (
        <p>Loading...</p>
      ) : error ? (
        <p>Error: {error.message}</p>
      ) : (
        <ul>
          {appointments.map((appointment) => (
            <li key={appointment.id}>
              {appointment.date}: {appointment.title}
            </li>
          ))}
        </ul>
      )}
    </div>
  );
};

export default AppointmentsPage;

In this example, we import the BriteAPI class from the briteapi package and use it to fetch appointments in the useEffect hook. We display a loading message while fetching appointments and handle any errors that may occur. Once the appointments are fetched successfully, we display them in a list.

You can similarly create pages to perform other CRUD operations like creating, updating, and deleting appointments, patients, premises, and providers using the respective methods provided by the BriteAPI SDK. Here's a generalized example of a booking application using all the methods available in the BriteAPI SDK:

// app/booking/page
"use client";
import React, { useState, useEffect } from "react";
import { BriteAPI } from "briteapi";

const BookingPage = () => {
  const [patients, setPatients] = useState([]);
  const [premises, setPremises] = useState([]);
  const [providers, setProviders] = useState([]);
  const [appointments, setAppointments] = useState([]);
  const [loading, setLoading] = useState(true);
  const [error, setError] = useState(null);

  useEffect(() => {
    const fetchData = async () => {
      try {
        const briteAPI = new BriteAPI("your_api_key_here");

        // Fetch patients
        const fetchedPatients = await briteAPI.fetchPatients();
        setPatients(fetchedPatients);

        // Fetch premises
        const fetchedPremises = await briteAPI.fetchPremises();
        setPremises(fetchedPremises);

        // Fetch providers
        const fetchedProviders = await briteAPI.fetchProviders();
        setProviders(fetchedProviders);

        // Fetch appointments
        const fetchedAppointments = await briteAPI.fetchAppointments();
        setAppointments(fetchedAppointments);

        setLoading(false);
      } catch (error) {
        setError(error);
        setLoading(false);
      }
    };

    fetchData();
  }, []);

  const createAppointment = async () => {
    try {
      const briteAPI = new BriteAPI("your_api_key_here");
      const newAppointment = {
        // Construct your appointment object here
      };
      await briteAPI.createAppointment(newAppointment);
      // Refresh appointments
      const fetchedAppointments = await briteAPI.fetchAppointments();
      setAppointments(fetchedAppointments);
    } catch (error) {
      setError(error);
    }
  };

  const cancelAppointment = async (id) => {
    try {
      const briteAPI = new BriteAPI("your_api_key_here");
      await briteAPI.deleteAppointment(id);
      // Refresh appointments
      const fetchedAppointments = await briteAPI.fetchAppointments();
      setAppointments(fetchedAppointments);
    } catch (error) {
      setError(error);
    }
  };

  //Add other similar methods for updating appointments, patients, premises, and providers

  return (
    <div>
      <h1>Booking Application</h1>
      {loading ? (
        <p>Loading...</p>
      ) : error ? (
        <p>Error: {error.message}</p>
      ) : (
        <div>
          {/* Render your booking components here */}
          <button onClick={createAppointment}>Create Appointment</button>
          <ul>
            {appointments.map((appointment) => (
              <li key={appointment.id}>
                {appointment.date}: {appointment.title}
                <button onClick={() => cancelAppointment(appointment.id)}>
                  Cancel
                </button>
              </li>
            ))}
          </ul>
        </div>
      )}
    </div>
  );
};

export default BookingPage;

In this example, we have a BookingPage component that fetches patients, premises, providers, and appointments using the respective methods from the BriteAPI SDK. It also includes methods to create and cancel appointments. You can expand upon this example to build a complete booking application with additional features and functionality.

Tutorials

Notice: COMING SOON.

Error Handling

Errors

The BriteAPI uses conventional HTTP response codes to indicate the success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted), and codes in the 5xx range indicate an error with BriteAPI servers (these are rare).

The BriteAPI uses the following error codes:

Error CodeMeaning
400Bad Request – Your request is invalid
401Unauthorized – Your API key is wrong
403Rate Limit Exceeded – The API is rate limited to 100 requests per second, per client. Try again later.
404Not Found – The specified resource could not be found
405Method Not Allowed – You tried to access a resource with an invalid method
406Not Acceptable – You requested a format that isn't JSON
410Gone – The resource requested has been removed from our servers
500Internal Server Error – We had a problem with our server. Try again later.
503Service Unavailable – We're temporarily offline for maintenance. Please try again later.

These error codes help you identify and troubleshoot issues when interacting with the BriteAPI. When you receive an error response, refer to the corresponding error code and its meaning to understand the nature of the problem.


Definations

Diseases API

Disease Name

The official name of the disease, which is widely recognized and used by healthcare professionals, researchers, and public health organizations.

Severity

An assessment of how serious the disease is. Severity levels can range from mild, causing minimal health impact, to severe, which may require intensive care or could be life-threatening.

Alternative Disease IDs

Other identifiers or codes that might be associated with the disease. These can include older nomenclature, regional codes, or alternative classification systems.

Parent IDs

Identifiers for the broader categories or classes to which the disease belongs. These help in understanding the disease's classification within larger medical and health taxonomies.

Definition

A brief explanation of the disease, highlighting key characteristics such as symptoms, causes, and potential effects on health.

Tree Numbers

Hierarchical codes that place the disease within a broader classification tree. Tree numbers help in understanding the disease's position within a classification system such as MeSH (Medical Subject Headings).

Parent Tree Numbers

The tree numbers for the parent categories of the disease. This helps in navigating up the classification hierarchy.

Synonyms

Alternate names or terms for the disease. These include historical names, colloquial terms, and variations used in different languages or regions.

Slim Mappings

Curated connections between detailed, specific disease classifications and broader, more general categories. Slim mappings simplify complex classification systems into more manageable groups for analysis, reporting, and educational purposes. They enable users to quickly understand the general category of a disease without navigating through detailed classification hierarchies.

TIP: JUST READ THE DOCS BRO! 😅

Best Practices for Using the Brite API

1. Secure Your API Key

When using the Brite API, always ensure the security of your API key. Follow these guidelines:

  • Store API Key Securely: Store your API key in a secure environment. Avoid hardcoding it directly into your application code, especially in publicly accessible repositories.

  • Use Environment Variables: Store your API key in environment variables or a configuration file, and reference it in your code. This helps keep your key hidden and allows for easy updates.

  • Limit Key Access: Restrict access to your API key to only trusted individuals and services. Do not share it openly.

2. Use HTTPS

Always make API requests over HTTPS to ensure data privacy and security. HTTPS encrypts the data exchanged between your application and the API server, protecting it from eavesdropping and tampering.

3. Validate API Responses

When consuming data from the Brite API, validate the responses to ensure they match the expected structure. This helps prevent unexpected errors in your application due to changes in the API.

4. Rate Limiting

Respect rate limits imposed by the API. Exceeding rate limits can result in temporary or permanent suspension of your API access. Implement rate limiting mechanisms in your application to avoid overloading the API.

5. Error Handling

Handle API errors gracefully. The Brite API may return errors for various reasons, such as invalid requests or server issues. Implement error handling in your application to provide informative error messages to users and log errors for debugging.

6. Use Descriptive Endpoint URLs

Use descriptive endpoint URLs that clearly indicate the purpose of the request. This makes your code more readable and maintainable.

7. Keep API Keys Secret

Do not expose your API key in client-side JavaScript. Making API requests directly from the client can expose your API key to potential attackers. Instead, use a server or a serverless function to proxy requests to the API while keeping your API key secure.

8. Monitor API Usage

Regularly monitor your API usage to ensure it aligns with your subscription plan. Be aware of your usage limits and consider upgrading your plan if needed.

9. Handle External Identifiers Licensing

If you plan to use external identifiers such as ICD-10, SNOMED, or MedDRA provided by the Brite API, make sure you have the necessary licensing in place. These identifiers may have their own licensing requirements, and you must comply with them.

10. Stay Informed

Stay informed about updates and changes to the Brite API by regularly checking the documentation and announcements from the API provider. Ensure your application remains compatible with any new versions or features.

By following these best practices, you can ensure the secure and reliable integration of the Brite API into your application, providing valuable healthcare information to your users while maintaining data security and compliance.

FAQs

FAQs

1. "My request keeps saying 'invalid API key,' but I checked my key, and it is valid. What's the issue?"

If you are encountering an "invalid API key" error, it may not necessarily be a problem with your API key itself. This issue could be related to how our DNS (Domain Name System) is configured for security purposes.

Technical Explanation:

  • Our DNS configuration designates the www subdomain (www.britelink.io) as the main domain for our API.
  • This means that DNS records are typically set up to point to the IP address associated with the www subdomain, and the web server is configured accordingly.

Solution:

To resolve the "invalid API key" issue, we recommend that you adjust your URL requests by adding "www" to the domain. Instead of using https://www.britelink.io/api/v1/drugs, please use https://www.britelink.io/api/v1/drugs.

Why Adding "www" Helps:

  • Adding "www" to the URL ensures that your requests go through the configured DNS records and reach our CORS (Cross-Origin Resource Sharing) server-side access control as intended.
  • This adjustment helps our server authenticate your requests correctly, preventing the "invalid API key" error and ensuring a smooth API interaction.

By following this recommendation and including "www" in your API requests, you should be able to resolve the issue and access our API successfully. If you continue to experience any problems or have further questions, please feel free to reach out to our support team for assistance.

BriteAI API Versions

Accessing API Versions

VersionReleasedRemoved
v0July, 2016March, 2022
v1September, 2016Current

You can access the latest version of the API docs using the base docs URL:

https://docs.britelink.io

This URL will always direct you to the most recent version of the BriteAI API.

API Upgrades and Changes

Keeping Track of Changes and Upgrades to the BriteAI API

Your API version (e.g., v1) controls the API behavior you experience (e.g., what properties you see in responses, what parameters you're allowed to send in requests, etc.). When we introduce changes to the API that are not backward-compatible, we release a new version. To prevent breaking your existing integrations, we support older versions for a reasonable period and assist users in migrating to the latest version. We won't remove older versions without ensuring that all customers have fully migrated. However, we encourage you to stay updated with the newer versions to benefit from enhancements and new features.

Backwards-Compatible Changes

BriteAI considers the following changes to be backwards-compatible:

  • Adding new API resources.
  • Introducing new optional request parameters to existing API methods.
  • Adding new properties to existing API responses.
  • Modifying the order of properties in existing API responses.
  • Altering the length or format of opaque strings, like error messages and other human-readable strings.
  • Enhancing the relevance or ordering of search results.

You can rest assured that object IDs will not change in length and will always be under 255 characters.

Upgrading Your API Version

If you’re using an older version of the API, upgrading to the latest version allows you to access new functionalities and streamline responses, enhancing the API's performance for your use. Upgrading your API version can impact:

  • The parameters you can send and the structure of objects you receive.
  • The parameters in headers that are required and returned.
  • The computation of request tallies for billing purposes.
  • The method of authentication.
  • The availability of endpoints. Some endpoints may be deprecated with major version changes.

To upgrade, simply modify the version number in your API requests (e.g., change “v0” to “v1”). It’s also possible to use two versions of the API concurrently, enabling iterative upgrades.

When performing an API upgrade, thoroughly review the change log below on the next page. Ensure that your tests pass against the endpoints you utilize in your application. You can test the new version while continuing to use the previous version in your production environment.


BriteAPI Changelog

The changelog is a curated list of notable updates in the BriteAPI DrugInfo. While minor backwards-compatible additions and improvements (such as performance enhancements of an endpoint) might not be listed here, significant new features and updates are documented.

April 2024

  • New Bookings and Scheduling API:
    • API, allows developers to seamlessly integrate dynamic medical booking and scheduling functionalities into their applications.
      • Developers can now draw from britelinks infrastructure to manage and facilitate medical appointments efficiently.

February 2024

  • New Clinical APIS:

    • Drug Dosage Information: Introduced a new endpoint, GET /api/v1/dosages, offering comprehensive drug dosage data across all available forms.
    • Food Interaction Endpoint: Added a sub-endpoint for drug-to-food interactions, enhancing the API's utility in clinical settings.
  • Chemistry API Updates:

    • Pagination Support: Implemented pagination for all endpoints, enabling smoother data retrieval for large datasets.
    • Enhanced Search and Filters: Incorporated dynamic fuzzy and exact search capabilities, improving accessibility to chemistry data.
    • Expanded Drug Classifications: Augmented the API with additional drug classifications, enriching the available chemical structure information.
  • New Disease API:

    • Comprehensive Disease Data: Released a new API endpoint, GET /api/v1/diseases, offering access to detailed information on over 5,000 diseases.
    • Advanced Search Capabilities: Enabled searching for diseases by name with options for fuzzy or exact matches, using the n and exact query parameters.
    • Customizable Detail Levels: The r query parameter lets users choose between receiving basic disease names or detailed information, including synonyms and classifications.
    • Dynamic Sorting and Pagination: Added functionality for alphabetical sorting (s and sOrder parameters) and cursor-based pagination to efficiently manage large datasets, supporting batch sizes up to 250.
  • Added Labs API:

    • Data Access for Laboratory Tests: Introduced a new API endpoint, GET /api/v1/labs, to provide access to a comprehensive list of laboratory tests.
    • Flexible Search: Users can search for tests based on test names, category names, or subcategory names using the n query parameter.
    • Conditional Field Inclusion: The r query parameter allows users to specify whether to include additional fields in the test model for detailed information.
    • Efficient Pagination: Implemented cursor-based pagination for smooth navigation through test data, with a default batch size of 25 tests.
  • Added Premises API:

    • Access to Premises Information: Introduced the GET /api/v1/premises endpoint for accessing premises information related to pharmacies and healthcare facilities.
    • Search by Premise Name: Users can search for premises by premise name(s) using the n query parameter.
    • Conditional Data Retrieval: The r query parameter provides the option to include additional fields in the premises data, enabling more detailed information when needed.
    • Efficient Pagination: Implemented cursor-based pagination for seamless retrieval of premises data, with a default batch size of 25 premises.

January 2024

  • Updated Condition Endpoint:

    • Enhanced Query Flexibility: The q parameter is now optional, enabling users to fetch all conditions or apply specific name-based filters.
    • Extended Data Retrieval: Added the r parameter to include detailed information about related drugs and indications in the response.
    • Improved Pagination: Introduced cursor-based pagination for efficient navigation through large datasets, with a default batch size of 10 conditions.
  • New API Endpoint - Categories: Added new endpoint GET /api/v1/categories for fetching categories of drugs. This endpoint supports filtering by category names and includes options for pagination and detailed drug information retrieval. Here are the key features:

    • Filtering by Category Names: Users can now filter categories by passing a comma-separated list of category names using the c query parameter.
    • Pagination Support: To handle large sets of data efficiently, the endpoint implements cursor-based pagination, allowing users to fetch categories in batches of 25. The cursor query parameter and a nextCursor in the response facilitate this functionality.
    • Drug Information Inclusion: An optional feature where users can choose to include related drug information in the category data by setting the r query parameter to true.
    • Enhanced Data Integrity and Security: The endpoint utilizes the stripServerHtml utility function to ensure the API response is free of HTML, catering to systems that require plain text data.
  • Updated - Get All Drugs Endpoint: The Get All Drugs endpoint has been enhanced with pagination support, improving data handling and user experience. The updated features include:

    • Cursor-Based Pagination: A nextCursor parameter is now included in responses, enabling efficient batch-wise data fetching and better handling of large datasets.
    • Improved Response Handling: The pagination update ensures a smoother and more manageable data retrieval process, especially for applications dealing with extensive drug databases.
  • New Utility Function - stripServerHtml: A new utility function stripServerHtml has been added to our suite of tools. This function is crucial for:

    • Removing HTML Content: It efficiently strips HTML content from API response data, ensuring compatibility with systems that necessitate plain text.
    • Enhancing Security: By removing HTML, it also reduces the risk of HTML injection attacks and improves overall data security.
    • Detailed usage and benefits can be found in Handling HTML Content.

December 2023

  • Enhanced: Added comprehensive drug interaction data. This update allows users to access detailed information on potential interactions between different drugs, enhancing patient safety and care.
  • Improved: Optimized API response times. Made significant backend improvements to ensure faster data retrieval, providing a more efficient user experience.

November 2023

  • New: Introduced optional JSON data returns, formatted according to FHIR-HL7 standards. This enhancement caters to the needs of systems utilizing FHIR-HL7, allowing for seamless integration and interoperability.
  • Added: Implemented a drug classification system. Users can now retrieve drugs based on their classification, aiding in more precise and categorically organized searches.

October 2023

  • Added: Implemented API authentication. Enhanced security measures now require API keys for accessing endpoints, ensuring secure and authorized usage.
  • Updated: Included drug formulation and packaging information. This additional data provides users with detailed insights into various drug formulations and packaging types available.

September 2023

  • Initial Release: Launched the BriteAPI with a set of core endpoints including drug identification, basic drug information, and dosage guidelines. This initial rollout marked the beginning of our journey to provide comprehensive and reliable clinical data services.
  • New: Added support for drug adverse effect data. This feature enables users to access information about potential side effects associated with different drugs.