Using Paged Results

Request

Search for all round pills, using a page size of 2 images, requesting page 3.

https://rximage.nlm.nih.gov/api/rximage/1/rxnav?shape=round&rPageSize=2&rPage=3

Remarks

Performing many queries such as the example given here of round pills will generate a large number of results, far more than a client application would normally want to display to the user on a single screen. To facilitate optimal server response and data transmission times it is therefore recommended to use paged results. In this example we set a page size of two images, which results in 409 pages, of which we request page 3 (response numbers based on queries made on 15-April-2013). A client application will always request page 1 initially, then read the total number of available pages from the replyStatus.totalPageCount element. Subsequent API requests are then made to request each page in turn as they are required. Requesting a page that does exist will result in an error return.

Reply, JSON format

{
{
   "replyStatus":{
      "success":true,
      "imageCount":2,
      "totalImageCount":817,
      "pageNumber":3,
      "totalPageCount":409
   },
   "nlmRxImages":[
      {
         "id":168874075,
         "ndc11":"00527-1311-01",
         "part":1,
         "status":"",
         "rxcui":857683,
         "splSetId":"fbf54709-5857-4dbc-9233-ebd7abff88c8",
         "name":"Terbutaline Sulfate 5 MG Oral Tablet",
         "labeler":"Lannett Company, Inc.",
         "imageUrl":"https:\/\/rximage.nlm.nih.gov\/image\/images\/gallery\/original\/00527-1311-01_RXNAVIMAGE10_2D2696B4.jpg",
         "imageSize":381687
      },
      {
         "id":168870794,
         "ndc11":"50111-0563-01",
         "part":1,
         "status":"",
         "rxcui":828348,
         "splSetId":"a88fa950-23d9-49fd-9340-b38a357760bf",
         "name":"Cyclobenzaprine hydrochloride 10 MG Oral Tablet",
         "labeler":"Pliva Inc.",
         "imageUrl":"https:\/\/rximage.nlm.nih.gov\/image\/images\/gallery\/original\/50111-0563-01_RXNAVIMAGE10_6B243581.jpg",
         "imageSize":472767
      }
   ]
}

Reply, XML format

<rxImageAccess xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://rximage.nlm.nih.gov/rxImageAccess.xsd">
  <replyStatus>
    <success>true</success>
    <imageCount>2</imageCount>
    <totalImageCount>817</totalImageCount>
    <pageNumber>3</pageNumber>
    <totalPageCount>409</totalPageCount>
  </replyStatus>
  <nlmRxImages>
    <image>
      <id>168874075</id>
      <ndc11>00527-1311-01</ndc11>
      <part>1</part>
      <status/>
      <rxcui>857683</rxcui>
      <splSetId>fbf54709-5857-4dbc-9233-ebd7abff88c8</splSetId>
      <name>Terbutaline Sulfate 5 MG Oral Tablet</name>
      <labeler>Lannett Company, Inc.</labeler>
      <imageUrl>
https://rximage.nlm.nih.gov/image/images/gallery/original/00527-1311-01_RXNAVIMAGE10_2D2696B4.jpg
      </imageUrl>
      <imageSize>381687</imageSize>
    </image>
    <image>
      <id>168870794</id>
      <ndc11>50111-0563-01</ndc11>
      <part>1</part>
      <status/>
      <rxcui>828348</rxcui>
      <splSetId>a88fa950-23d9-49fd-9340-b38a357760bf</splSetId>
      <name>Cyclobenzaprine hydrochloride 10 MG Oral Tablet</name>
      <labeler>Pliva Inc.</labeler>
      <imageUrl>
https://rximage.nlm.nih.gov/image/images/gallery/original/50111-0563-01_RXNAVIMAGE10_6B243581.jpg
      </imageUrl>
      <imageSize>472767</imageSize>
    </image>
  </nlmRxImages>
</rxImageAccess>

Response Referenced Images

00527-1311-01_rxnavimage10_2d2696b4.jpg 50111-0563-01_rxnavimage10_6b243581.jpg


Page Tools