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:
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/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
Parameter | Description |
---|---|
chemicalStructureId | The 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.