What a medicine is for, how to take it, warnings and side effects
Returns the key sections of a medicine's official label: active ingredient, uses, dosage, warnings, when not to use it, side effects, pregnancy and storage.
Request
GEThttps://drug-information.p.apihiver.com/v1/label?name=ibuprofen
*
String. Brand or generic medicine name, e.g.
ibuprofen. Language
Client
1curl --request GET \
2 --url 'https://drug-information.p.apihiver.com/v1/label?name=ibuprofen' \
3 --header 'Accept: application/json' \
4 --header 'X-API-Key: YOUR_API_KEY'What a medicine is for, how to take it, warnings and side effects: Drug Information API reference
Returns the key sections of a medicine's official label: active ingredient, uses, dosage, warnings, when not to use it, side effects, pregnancy and storage. This endpoint is part of the Drug Information API: Medicine information from the US FDA: uses, dosage, warnings, side effects, reported adverse events and recalls.
What a medicine is for, how to take it, warnings and side effects: example requests in every language
GET /v1/label in Shell (cURL)
curl --request GET \
--url 'https://drug-information.p.apihiver.com/v1/label?name=ibuprofen' \
--header 'Accept: application/json' \
--header 'X-API-Key: YOUR_API_KEY'GET /v1/label in Shell (HTTPie)
http GET 'https://drug-information.p.apihiver.com/v1/label?name=ibuprofen' \
Accept:application/json \
X-API-Key:YOUR_API_KEYGET /v1/label in Shell (Wget)
wget --quiet \
--method GET \
--header 'Accept: application/json' \
--header 'X-API-Key: YOUR_API_KEY' \
--output-document \
- 'https://drug-information.p.apihiver.com/v1/label?name=ibuprofen'GET /v1/label in Node.js (http)
const http = require('https');
const options = {
method: 'GET',
hostname: 'drug-information.p.apihiver.com',
port: null,
path: '/v1/label?name=ibuprofen',
headers: {
Accept: 'application/json',
'X-API-Key': 'YOUR_API_KEY'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();GET /v1/label in Node.js (Request)
const request = require('request');
const options = {
method: 'GET',
url: 'https://drug-information.p.apihiver.com/v1/label',
qs: {name: 'ibuprofen'},
headers: {Accept: 'application/json', 'X-API-Key': 'YOUR_API_KEY'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});GET /v1/label in Node.js (Unirest)
const unirest = require('unirest');
const req = unirest('GET', 'https://drug-information.p.apihiver.com/v1/label');
req.query({
name: 'ibuprofen'
});
req.headers({
Accept: 'application/json',
'X-API-Key': 'YOUR_API_KEY'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});GET /v1/label in Node.js (Axios)
const axios = require('axios').default;
const options = {
method: 'GET',
url: 'https://drug-information.p.apihiver.com/v1/label',
params: {name: 'ibuprofen'},
headers: {Accept: 'application/json', 'X-API-Key': 'YOUR_API_KEY'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}GET /v1/label in Node.js (Fetch)
const fetch = require('node-fetch');
const url = 'https://drug-information.p.apihiver.com/v1/label?name=ibuprofen';
const options = {
method: 'GET',
headers: {Accept: 'application/json', 'X-API-Key': 'YOUR_API_KEY'}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}GET /v1/label in JavaScript (XMLHttpRequest)
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', 'https://drug-information.p.apihiver.com/v1/label?name=ibuprofen');
xhr.setRequestHeader('Accept', 'application/json');
xhr.setRequestHeader('X-API-Key', 'YOUR_API_KEY');
xhr.send(data);GET /v1/label in JavaScript (Axios)
import axios from 'axios';
const options = {
method: 'GET',
url: 'https://drug-information.p.apihiver.com/v1/label',
params: {name: 'ibuprofen'},
headers: {Accept: 'application/json', 'X-API-Key': 'YOUR_API_KEY'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}GET /v1/label in JavaScript (Fetch)
const url = 'https://drug-information.p.apihiver.com/v1/label?name=ibuprofen';
const options = {
method: 'GET',
headers: {Accept: 'application/json', 'X-API-Key': 'YOUR_API_KEY'}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}GET /v1/label in JavaScript (jQuery)
const settings = {
async: true,
crossDomain: true,
url: 'https://drug-information.p.apihiver.com/v1/label?name=ibuprofen',
method: 'GET',
headers: {
Accept: 'application/json',
'X-API-Key': 'YOUR_API_KEY'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});GET /v1/label in Python (http.client)
import http.client
conn = http.client.HTTPSConnection("drug-information.p.apihiver.com")
headers = {
'Accept': "application/json",
'X-API-Key': "YOUR_API_KEY"
}
conn.request("GET", "/v1/label?name=ibuprofen", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))GET /v1/label in Python (Requests)
import requests
url = "https://drug-information.p.apihiver.com/v1/label"
querystring = {"name":"ibuprofen"}
headers = {
"Accept": "application/json",
"X-API-Key": "YOUR_API_KEY"
}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())GET /v1/label in PHP (cURL)
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://drug-information.p.apihiver.com/v1/label?name=ibuprofen",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"X-API-Key: YOUR_API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}GET /v1/label in PHP (Guzzle)
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://drug-information.p.apihiver.com/v1/label?name=ibuprofen', [
'headers' => [
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY',
],
]);
echo $response->getBody();GET /v1/label in PHP (PECL HTTP v1)
<?php
$request = new HttpRequest();
$request->setUrl('https://drug-information.p.apihiver.com/v1/label');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'name' => 'ibuprofen'
]);
$request->setHeaders([
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}GET /v1/label in PHP (PECL HTTP v2)
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://drug-information.p.apihiver.com/v1/label');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'name' => 'ibuprofen'
]));
$request->setHeaders([
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();GET /v1/label in Java (AsyncHttp)
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "https://drug-information.p.apihiver.com/v1/label?name=ibuprofen")
.setHeader("Accept", "application/json")
.setHeader("X-API-Key", "YOUR_API_KEY")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();GET /v1/label in Java (java.net.http)
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://drug-information.p.apihiver.com/v1/label?name=ibuprofen"))
.header("Accept", "application/json")
.header("X-API-Key", "YOUR_API_KEY")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());GET /v1/label in Java (OkHttp)
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://drug-information.p.apihiver.com/v1/label?name=ibuprofen")
.get()
.addHeader("Accept", "application/json")
.addHeader("X-API-Key", "YOUR_API_KEY")
.build();
Response response = client.newCall(request).execute();GET /v1/label in Java (Unirest)
HttpResponse<String> response = Unirest.get("https://drug-information.p.apihiver.com/v1/label?name=ibuprofen")
.header("Accept", "application/json")
.header("X-API-Key", "YOUR_API_KEY")
.asString();GET /v1/label in C# (HttpClient)
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://drug-information.p.apihiver.com/v1/label?name=ibuprofen"),
Headers =
{
{ "Accept", "application/json" },
{ "X-API-Key", "YOUR_API_KEY" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}GET /v1/label in C# (RestSharp)
var client = new RestClient("https://drug-information.p.apihiver.com/v1/label?name=ibuprofen");
var request = new RestRequest("", Method.Get);
request.AddHeader("Accept", "application/json");
request.AddHeader("X-API-Key", "YOUR_API_KEY");
var response = client.Execute(request);GET /v1/label in Go (NewRequest)
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://drug-information.p.apihiver.com/v1/label?name=ibuprofen"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("X-API-Key", "YOUR_API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}GET /v1/label in Ruby (net::http)
require 'uri'
require 'net/http'
url = URI("https://drug-information.p.apihiver.com/v1/label?name=ibuprofen")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Accept"] = 'application/json'
request["X-API-Key"] = 'YOUR_API_KEY'
response = http.request(request)
puts response.read_bodyGET /v1/label in Swift (NSURLSession)
import Foundation
let headers = [
"Accept": "application/json",
"X-API-Key": "YOUR_API_KEY"
]
let request = NSMutableURLRequest(url: NSURL(string: "https://drug-information.p.apihiver.com/v1/label?name=ibuprofen")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()GET /v1/label in Objective-C (NSURLSession)
#import <Foundation/Foundation.h>
NSDictionary *headers = @{ @"Accept": @"application/json",
@"X-API-Key": @"YOUR_API_KEY" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://drug-information.p.apihiver.com/v1/label?name=ibuprofen"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];GET /v1/label in Kotlin (OkHttp)
val client = OkHttpClient()
val request = Request.Builder()
.url("https://drug-information.p.apihiver.com/v1/label?name=ibuprofen")
.get()
.addHeader("Accept", "application/json")
.addHeader("X-API-Key", "YOUR_API_KEY")
.build()
val response = client.newCall(request).execute()GET /v1/label in C (libcurl)
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://drug-information.p.apihiver.com/v1/label?name=ibuprofen");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Accept: application/json");
headers = curl_slist_append(headers, "X-API-Key: YOUR_API_KEY");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);GET /v1/label in Clojure (clj-http)
(require '[clj-http.client :as client])
(client/get "https://drug-information.p.apihiver.com/v1/label" {:headers {:X-API-Key "YOUR_API_KEY"}
:query-params {:name "ibuprofen"}
:accept :json})GET /v1/label in OCaml (CoHTTP)
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "https://drug-information.p.apihiver.com/v1/label?name=ibuprofen" in
let headers = Header.add_list (Header.init ()) [
("Accept", "application/json");
("X-API-Key", "YOUR_API_KEY");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)GET /v1/label in R (httr)
library(httr)
url <- "https://drug-information.p.apihiver.com/v1/label"
queryString <- list(name = "ibuprofen")
response <- VERB("GET", url, query = queryString, add_headers('X-API-Key' = 'YOUR_API_KEY'), content_type(""), accept("application/json"))
content(response, "text")GET /v1/label in PowerShell (Invoke-WebRequest)
$headers=@{}
$headers.Add("Accept", "application/json")
$headers.Add("X-API-Key", "YOUR_API_KEY")
$response = Invoke-WebRequest -Uri 'https://drug-information.p.apihiver.com/v1/label?name=ibuprofen' -Method GET -Headers $headersGET /v1/label in PowerShell (Invoke-RestMethod)
$headers=@{}
$headers.Add("Accept", "application/json")
$headers.Add("X-API-Key", "YOUR_API_KEY")
$response = Invoke-RestMethod -Uri 'https://drug-information.p.apihiver.com/v1/label?name=ibuprofen' -Method GET -Headers $headersGET /v1/label in HTTP (HTTP/1.1)
GET /v1/label?name=ibuprofen HTTP/1.1
Accept: application/json
X-Api-Key: YOUR_API_KEY
Host: drug-information.p.apihiver.com
Example response (200, application/json)
Success.
1{
2 "uses": "Uses temporarily relieves minor aches and pains due to: headache toothache backache menstrual cramps the common cold muscular aches minor pain of arthritis temporarily reduces fever",
3 "dosage": "Directions do not take more than directed the smallest effective dose should be used adults and children 12 years and over: take 1 tablet every 4 to 6 hours while symptoms persist if pain or fever does not respond to 1 tablet, 2 tablets may be used do not exceed 6 tablets in 24 hours, unless directed by a doctor children under 12 years: ask a doctor",
4 "source": "openFDA",
5 "storage": "Other information store between 20°-25°C (68°-77°F) avoid excessive heat 40°C (104°F) see end flap for expiration date and lot number",
6 "warnings": "Warnings Allergy alert: Ibuprofen may cause a severe allergic reaction, especially in people allergic to aspirin. Symptoms may include: rash facial swelling asthma (wheezing) hives skin reddening shock blisters If an allergic reaction occurs, stop use and seek medical help right away. Stomach bleeding warning: This product contains an NSAID, which may cause severe stomach bleeding. The chance is h…",
7 "pregnancy": "If pregnant or breast-feeding, ask a health professional before use. It is especially important not to use ibuprofen at 20 weeks or later in pregnancy unless definitely directed to do so by a doctor because it may cause problems in the unborn child or complications during delivery.",
8 "disclaimer": "U.S. FDA label data for general information only; not medical advice. Consult a doctor or pharmacist.",
9 "do_not_use": "Do not use if you have ever had an allergic reaction to any other pain reliever/fever reducer right before or after heart surgery",
10 "brand_names": [
11 "Ibuprofen Dye Free"
12 ],
13 "manufacturer": "CVS Pharmacy",
14 "side_effects": "Stop use and ask a doctor if you experience any of the following signs of stomach bleeding: feel faint have bloody or black stools vomit blood have stomach pain that does not get better you have symptoms of heart problems or stroke: chest pain slurred speech trouble breathing leg swelling weakness in one part or side of body pain gets worse or lasts more than 10 days fever gets worse or lasts more…",
15 "generic_names": [
16 "IBUPROFEN"
17 ],
18 "active_ingredient": "Active ingredient (in each white tablet) Ibuprofen USP, 200 mg (NSAID)* *nonsteroidal anti-inflammatory drug"
19}Errors
- 400 — A required parameter is missing or a value has the wrong format.
1{ 2 "error": { 3 "code": "INVALID_INPUT", 4 "message": "name: Field required" 5 } 6}
Gateway errors (missing key, no subscription, rate limits) are listed in Error codes.