Query
Medication Search
Inside Rx provides several endpoints design to return various medication related information. The Medication Search Query endpoint can be used to search for a matching medication, even with partial name.
The Medication Search 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.
Medication Search Query
The GET request is designed to work like a search query, where the medication name is partially known. It returns a set of results matching the query. It will match the brand name and as well as the generic name. A query can be a full or partial name match. This service works great for building Type-A-Head searches due the complex nature of medication names.
HTTP Request
GET https://services.insiderx.com/search/v1/?query=:query 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 :query is the string of text representing a partial or full medication name.
HTTP GET Params
| param | Description |
|---|---|
query | string (required) A partial or full medication name. |
locale | string (optional) Localization of the medication attributes. Either en-US (default), or es-US |
limit | string (optional) Limits number of returned entries to [1...10], defaults to 10 |
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 query, returns empty array |
| 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[].name | string Generic or Brand name of the medication. |
results[].generic | string Generic name of the medication, can be a duplicate name attribute. |
results[].dose[].package | boolean True if the medication is a package. |
results[].dose[].label | string Display label for the dose. |
results[].dose[].value | string Value refers to the NDC for this specific strength and form. |
results[].dose[].baseValue | string Base Value used when calculating custom quantity to price. |
results[].dose[].unitLabel | string Display label for the unit. |
results[].dose[].quantity[].label | string Display label for the quantity. |
results[].dose[].quantity[].value | string Value of the quantity. |
results[].dose[].defaultQuantity | string Value of the most commonly prescribed quantity. |
results[].dose[].program | boolean True if medication is covered in a special program that has additional restrictions. NOTE - Only applicable if your contract participates in that program. |
results[].dose[].doseForm | string Form for the dose. |
results[].defaultDose | string NDC of the most commonly prescribed dose. |
results[].slug | string External ID that is unique and URL friendly. |
results[].genericSlug | string The slug identifier of the generic version of this drug. It will be null if there is no generic version available. |
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/?query=Nexium&limit=2 \
-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": [
{
"name": "Medication A",
"generic": "generic a",
"dose": [
{
"package": false,
"label": "10 mg",
"value": "00000000001",
"baseValue": "1",
"unitLabel": "tab(s)",
"quantity": [
{
"label": "30 tab(s)",
"value": "30"
},
...
],
"defaultQuantity": "30"
},
...
],
"defaultDose": "00000000001",
"slug": "medication-a",
},
...
]
}Example JSON Response for Missing or Incorrect Request Data
{
"id": "d54c54ad-40be-4305-8a34-0ab44710b90d",
"message": "Incorrect or missing required parameters.",
"statusCode": 400,
"errorCode": "QUERY_INCORRECT_OR_MISSING"
}Error Codes
| Error Code | Description |
|---|---|
LIMIT_INCORRECT_OR_MISSING | HTTP GET parameter limit is invalid. |
LOCALE_INCORRECT_OR_MISSING | HTTP GET parameter locale is invalid. |
QUERY_INCORRECT_OR_MISSING | HTTP GET parameter query is invalid. |