Consumer Health


Browse our guides and interact with our API reference for more information about MEDSAPI Consumer Health. Try MEDSAPI Consumer Health and learn about core concepts.





Search Code Samples

Use the code samples below as examples to create an application in your desired language.  The following code samples use the /v1/content/search endpoint to search articles.  Get started and begin to understand the endpoint by following the examples below in the language of your choice. Substitute a valid token for the placeholder below to run the examples.


Code Samples

# Search Consumer Health:

curl -X POST "" -H "accept: application/json" 
-H "Authorization: Bearer TOKEN" -H "Content-Type: application/json" -d "{ \"query\": \"chromosomal abnormalities\", \"pageSize\": 10, 
\"fields\": [ \"title\" ]}"
// Search Consumer Health:

// Construct the client
OkHttpClient client = new OkHttpClient();

// Create the URL
HttpUrl url = new HttpUrl.Builder()

// Build the body   
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{ \"query\": \"chromosomal abnormalities\", \"pageSize\": \"10\", \"fields\": [ \"title\" ]}");  

// Build the request
Request request = new Request.Builder()
    .addHeader("Accept", "application/json")
    .addHeader("Authorization", "Bearer TOKEN")
    .addHeader("Content-Type", "application/json")
// Search Consumer Health: 

const host = "";
const  path = "/medsapi-consumer-health/v1/content/search";

// Create the Request
const url = host + path;
const requestBody = {
  "query": "chromosomal abnormalities",
  "pageSize": 10,
  "fields": [
const settings = {
  "async": true,
  "crossDomain": true,
  "url": url,
  "method": "POST",
  "processData": false,
  "data": JSON.stringify(requestBody),
  "headers": {
        Accept: "application/json",
        Authorization: "Bearer TOKEN",
        "Content-Type": "application/json"

// Send the Request
$.ajax(settings).done(function (response) {
# Search Consumer Health

# Form the URL 
urlstr = File.join('https://', '', '/medsapi-consumer-health', '/v1/content/search')
url = URI(urlstr)

# Create the HTTP object
http =, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

# Create the request
request =
request["Accept"] = "application/json"
request["Authorization"] = "Bearer TOKEN"
request["Content-Type"] = "application/json"
request.body = { query: 'chromosomal abnormalities', pageSize: '10', fields: [ 'title' ]}.to_json

# Send the request
response = http.request(request)
# Search Consumer Health

# Form the URL
url = ''.join(['/medsapi-consumer-health','/v1', '/content/search'])

# Create Connection Instance
conn = http.client.HTTPSConnection("")

# Payload
payload = '{"query":"chromosomal abnormalities","pageSize":10,"fields":["title"]}'

# Create the Request Headers
headers = {
    "Authorization": "Bearer TOKEN",
    "Accept": "application/json",
    "Cache-Control": "no-cache",

# Send Request  
conn.request("POST", url, payload, headers)