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:
Header | Value |
---|---|
Authorization | Bearer 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.