Alternatives
Medication Alternatives
Inside Rx provides an endpoint that will return similar medications for a given medication. This is ideal in situations where brand and generic versions of a medication is needed.
The Medication Alternatives API is restricted with a x-api-key header. This API Key is provided when provisioning your account. It will authorize you for these endpoints, and is required for all requests.
HTTP Request
GET https://services.insiderx.com/search/v1/alternatives/?slug=:slug HTTP/1.1
Content-Type: application/json
x-api-key: zW7PKpzy6X7UHlI4NymTG8QmYhSlFwVd44xapRCtWhere x-api-key is the private key provided when provisioning an account. The example key above is for demonstration purposes.
Where :slug is the unique identification that represents a medication name.
HTTP GET Params
| param | Description |
|---|---|
slug | string (required) Unique medication identifier. |
Response Types
| Code | Description |
|---|---|
| 200 | Successful results returned. |
| 400 | Incorrect or missing required parameters. |
| 403 | Lack of permissions to use medication search service. |
| 404 | No medication matched slug. |
| 500 | Internal server error, something went wrong. |
Response Attributes
The following attributes are returned as a array of objects within the response body. Dot notation is used to represent nested objects. Square bracket notation represents items are nested within an array.
| Attribute | Description |
|---|---|
id | string Internal ID used for tracking purposes. |
results[].slug | string Unique medication identifier. |
results[].label | string Generic or Brand name of the medication. |
results[].generic | boolean Flag that indicates if generic or not. |
statusCode | integer (optional) HTTP status code in case of failure. |
message | string (optional) Error description. |
errorCode | string (optional) Error Code for validation failures. See Error Codes. |
Example CURL Request
curl https://services.insiderx.com/search/v1/alternatives/?slug=prinivil \
-H "Content-Type: application/json" \
-H "x-api-key: zW7PKpzy6X7UHlI4NymTG8QmYhSlFwVd44xapRCt"Where x-api-key is the private key provided when provisioning an account. The example key above is for demonstration purposes.
Example JSON Response
{
"id": "d54c54ad-40be-4305-8a34-0ab44710b90d",
"results": [
{
"label": "Lisinopril",
"slug": "lisinopril",
"generic": true
},
{
"label": "Prinivil",
"slug": "prinivil",
"generic": false
},
{
"label": "Zestril",
"slug": "zestril",
"generic": false
}
]
}Example JSON Response for Missing or Incorrect Request Data
{
"id": "d54c54ad-40be-4305-8a34-0ab44710b90d",
"message": "Incorrect or missing required parameters.",
"statusCode": 400,
"errorCode": "SLUG_INCORRECT_OR_MISSING"
}Error Codes
| Error Code | Description |
|---|---|
SLUG_INCORRECT_OR_MISSING | HTTP GET parameter slug is invalid. |