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





V2 Search (using POST) Code Samples

Use the code samples below as examples to create an application in your desired language.  The following code samples use the POST /v2/content/search endpoint which allows you to execute a search request.  The GET is deprecated in favor of the POST. Get started and begin to understand the endpoint by following the examples below in the language of your choice. 


Code Samples

# Search content

curl -X POST ""
    -H "Content-Type: application/json"
    -H "Accept: application/json"
    -H "Authorization: Bearer TOKEN"
    -d '{"query":"heart attack","fields":["title"]}'

// Search content

// 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\": \"heart attack\", \"fields\": [ \"title\"]}")

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

// Send the request
Response response = client.newCall(request).execute();

// Search content

const host = "";
const path = "/medsapi-dynamed/v2/content/search";

// Create the Request
const url = host + path;
const requestBody = {
  "query": "heart attack",
  "fields": [

const settings = {
    "async": true,
    "crossDomain": true,
    "url": url,
    "method": "POST",
    "headers": {
        "Content-Type": "application/json",
        "Accept": "application/json",
        "Authorization": "Bearer TOKEN"
    "processData": false,
    "data": JSON.stringify(requestBody)

// Send the Request
$.ajax(settings).done(function (response) {

# Search content

# Form the URL
urlstr = File.join("https://", "", "/medsapi-dynamed/v2/content/search")
url = URI.parse(urlstr)

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

# Create the request
request =
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Authorization"] = "Bearer TOKEN"
request.body = {
  "query": "heart attack",
  "fields": [

# Send the request
response = http.request(request)

# Search content

# Form the URL
url = "/medsapi-dynamed/v2/content/search"

# Payload
payload = {
  "query": "heart attack",
  "fields": [

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

# Create the Request Headers
headers = {
        "Content-Type": "application/json",
        "Accept": "application/json",
        "Authorization": "Bearer TOKEN"

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