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.