Clarification of the Object table and JSON output of drug prices API of Drugbank
In this article, I will provide a clear explanation of the object table and JSON output of the Drugbank drug prices API. As a reader with programming knowledge, you likely understand what an object table and JSON are, but I will specifically focus on how they are utilized in the Drugbank drug prices API. By the end of this article, you will have a better understanding of the structure and format of the object table and JSON output, which will help you to effectively work with the Drugbank drug prices API.
Object and Description table
Objects | Description |
prices | |
description | |
cost | Drug price per unit. |
currency | Currency of price, example: USD. |
unit |
prices
: This object represents the prices of a drug. It contains information such as the cost of the drug per unit and the currency in which the price is listed.description
: This object represents the description of a drug. It may contain information such as the brand name, generic name, or any other relevant details about the drug.cost
: This object represents the cost of a drug per unit. It may be listed in a specific currency.currency
: This object represents the currency in which the price of a drug is listed. It is usually listed using the ISO 4217 currency codes, such as USD for United States Dollars or EUR for Euros.unit
: This object represents the unit of measurement for a drug. It may be listed in various units such as grams, milligrams, or micrograms depending on the specific drug.
The information in the table is useful for developers who are building applications or tools that require drug pricing data. With this information, developers can retrieve drug pricing data from the Drugbank drug prices API and incorporate it into their applications. The prices
object provides the cost of the drug per unit, and the currency
object provides the currency in which the price is listed. This allows developers to easily compare drug prices across different currencies and make informed decisions when building their applications. Additionally, the description
and unit
objects can provide useful contextual information for the drugs being priced, helping developers to build more accurate and informative applications.
JSON explained
The JSON output represents drug pricing data for two different drugs, Demeclocycline and Declomycin. Each drug is represented as an object within an array, with the array being labeled as prices
. Each object contains four key-value pairs: description
, cost
, currency
, and unit
. The description
key provides a brief description of the drug, including the drug name and dosage strength. The cost
key provides the price of the drug per unit, which is listed as a string value. The currency
key indicates the currency in which the drug price is listed, which in this case is United States Dollars (USD). Finally, the unit
key provides the unit of measurement for the drug, which in this case is a tablet. Overall, this JSON output provides developers with the necessary drug pricing data to build applications that require accurate and up-to-date drug pricing information.
{
"prices": [
{
"description": "Demeclocycline 150 mg tablet",
"cost": "9.42",
"currency": "USD",
"unit": "tablet"
},
{
"description": "Declomycin 150 mg tablet",
"cost": "12.31",
"currency": "USD",
"unit": "tablet"
}
]
}
Ending words
We discussed the object table and JSON output of the Drugbank drug prices API. We provided a detailed description of each object in the table, including prices, description, cost, currency, and unit. We also analyzed a sample JSON output, which provided drug pricing data for two different drugs. The information provided in this conversation is useful for developers who are building applications or tools that require drug pricing data. By utilizing the Drugbank drug prices API and understanding the structure and format of the object table and JSON output, developers can access accurate and up-to-date drug pricing information, allowing them to build more informed and effective applications.
Source
You can request access to the Drugbank drug prices API through the third-party data marketplace of World in Data. World in Data provides access to a wide range of public datasets, including the Drugbank drug prices API. By requesting access to this API through World in Data, developers can quickly and easily integrate drug pricing data into their applications. World in Data also provides documentation and support to help developers get started with the API. Overall, requesting access to the Drugbank drug prices API through World in Data can be a convenient and efficient way for developers to access the data they need to build their applications.