Answers.Body: <p>As arupgsh says, you need to use esearch to get a list of unique identifiers before using efetch to retrieve info about each result. I think the easiest way to do this is to use <a href="https://www.ncbi.nlm.nih.gov/books/NBK179288" rel="nofollow noreferrer">Entrez Direct</a>, which allows you to simply pipe esearch output to efetch:</p>
  
  <pre><code>esearch -db books -query NBK1440 | efetch -format docsum
  </code></pre>
  
  <p>or</p>
  
  <pre><code>esearch -db books -query NBK1440 | esummary
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-01T14:54:09.100Z
Answers.LastActivityDate: 2017-11-01T14:54:09.100Z
Answers.UserDisplayName: heathobrien
Answers.Body: <p>Entrez requires the unique identifiers(UID) for fetching related info. The id you are using in the query is RID. I guess that why you are getting <code>&lt;ERROR&gt;UID=1440: cannot get document summary&lt;/ERROR&gt;</code>.</p>
  
  <p>List of example uids using the term "ncbi+blast":</p>
  
  <p><a href="https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=books&amp;term=ncbi+blast" rel="noreferrer">https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=books&amp;term=ncbi+blast</a></p>
  
  <p>Summary of the first item:</p>
  
  <p><a href="https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=books&amp;id=4459608" rel="noreferrer">https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=books&amp;id=4459608</a></p>
  
  <p>Using the Entrez python package:</p>
  
  <pre><code>from Bio import Entrez
  Entrez.email = "youremail@domain.com"
  handle = Entrez.esummary(db="books", id="4459608,4456634", retmode="xml")
  records = Entrez.parse(handle)
  for record in records:
       print(record['Title'])
  handle.close()
  </code></pre>
  
  <p>I'm not sure about the availability of book abstracts.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-02T03:00:55.963Z
Answers.Text: Thanks - yes the ClinVar citation_id was a RID for bookshelf not an ID like it is for Pubmed and PMC
Answers.UserDisplayName: David Lawrence
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-01T13:22:36.060Z
Answers.LastActivityDate: 2017-11-01T13:27:49.157Z
Answers.LastEditDate: 2017-11-01T13:27:49.157Z
Answers.UserDisplayName: arup
Body: <p>I want to retrieve abstracts/summaries for NCBI bookshelf entries, eg: "NBK1440"</p>
  
  <p><a href="https://www.ncbi.nlm.nih.gov/books/NBK25497/table/chapter2.T._entrez_unique_identifiers_ui/?report=objectonly" rel="nofollow noreferrer">Docs</a> say the dbname is "books" and <a href="https://dataguide.nlm.nih.gov/eutilities/utilities.html#efetch" rel="nofollow noreferrer">efetch guide</a> says a rettype of "docsum" works for all databases. However when I make the query:</p>
  
  <pre><code>https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=books&amp;id=NBK1440&amp;rettype=docsum
  </code></pre>
  
  <p>returns:</p>
  
  <pre><code>&lt;ERROR&gt;UID=1440: cannot get document summary&lt;/ERROR&gt;
  </code></pre>
  
  <p>The default query is useless (just echos back the ID): </p>
  
  <pre><code>https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=books&amp;id=NBK1440&amp;retmode=text
  </code></pre>
  
  <p>returns</p>
  
  <pre><code>1440
  </code></pre>
  
  <p>Picking another 3:</p>
  
  <pre><code>https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=books&amp;id=NBK1391,NBK410087,NBK1391&amp;rettype=docsum
  </code></pre>
  
  <p>Fails the same way:</p>
  
  <pre><code>&lt;ERROR&gt;UID=1391: cannot get document summary&lt;/ERROR&gt;
  &lt;ERROR&gt;UID=410087: cannot get document summary&lt;/ERROR&gt;
  &lt;ERROR&gt;UID=1391: cannot get document summary&lt;/ERROR&gt;
  </code></pre>
  
  <p>The same goes for esummary:</p>
  
  <pre><code>https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=books&amp;id=1440
  </code></pre>
  
  <p>Dies on NBK1440 and removing NBK gives:</p>
  
  <pre><code>&lt;ERROR&gt;UID=1440: cannot get document summary&lt;/ERROR&gt;
  </code></pre>
  
  <p>The values come from the (9Mb) ClinVar citations file:  <a href="https://ftp.ncbi.nlm.nih.gov/pub/clinvar/tab_delimited/var_citations.txt" rel="nofollow noreferrer">https://ftp.ncbi.nlm.nih.gov/pub/clinvar/tab_delimited/var_citations.txt</a> - the first is from tihs line:</p>
  
  <pre><code>15048   9   1800562     NCBIBookShelf   NBK1440
  </code></pre>
  
  <p><strong>ANSWER</strong></p>
  
  <p>Thanks to arupgsh - yes the ClinVar citation_id was a RID for bookshelf not an ID like it is for Pubmed and PMC. FYI my solution was:</p>
  
  <pre><code>def get_summary_for_bookshelf_rid(bookshelf_rid):
      handle = Entrez.esearch(db="books", term=bookshelf_rid)
      search_results = Entrez.read(handle)
      handle = Entrez.esummary(db="books", id=','.join(search_results['IdList']))
      results = Entrez.read(handle)
  
      for r in results:
          if r["RID"] == bookshelf_rid:
              return r
  
      return None
  
  get_summary_for_bookshelf_rid("NBK1440")
  </code></pre>
  
  <p>returns:</p>
  
  <pre><code>{'PubDate': '2000/04/03 00:00', 'Title': 'HFE-Associated Hereditary Hemochromatosis', 'Text': '', 'RType': 'chapter', u'Id': '1475938', u'Item': [], 'Book': 'gene', 'Parents': '', 'RID': 'NBK1440', 'ID': 'gene/chapter/hemochromatosis/PMC'}
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-02T11:21:45.927Z
Comments.Text: But unlike PubMed article, there is no entry for abstracts for NCBI bookshelf.
Comments.UserDisplayName: arup
Tags: <api><data-retrieval>
Title: Retrieve abstract/summary for NCBI bookshelf via Entrez
ThreadText: # Retrieve abstract/summary for NCBI bookshelf via Entrez
  
  (Asked by: username_0 on 2017-10-31)
  
  I want to retrieve abstracts/summaries for NCBI bookshelf entries, eg: "NBK1440"
  
  [Docs](https://www.ncbi.nlm.nih.gov/books/NBK25497/table/chapter2.T._entrez_unique_identifiers_ui/?report=objectonly) say the dbname is "books" and [efetch guide](https://dataguide.nlm.nih.gov/eutilities/utilities.html#efetch) says a rettype of "docsum" works for all databases. However when I make the query:
  
  ```
  https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=books&id=NBK1440&rettype=docsum
  
  ```
  
  returns:
  
  ```
  <ERROR>UID=1440: cannot get document summary</ERROR>
  
  ```
  
  The default query is useless (just echos back the ID):
  
  ```
  https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=books&id=NBK1440&retmode=text
  
  ```
  
  returns
  
  ```
  1440
  
  ```
  
  Picking another 3:
  
  ```
  https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=books&id=NBK1391,NBK410087,NBK1391&rettype=docsum
  
  ```
  
  Fails the same way:
  
  ```
  <ERROR>UID=1391: cannot get document summary</ERROR>
  <ERROR>UID=410087: cannot get document summary</ERROR>
  <ERROR>UID=1391: cannot get document summary</ERROR>
  
  ```
  
  The same goes for esummary:
  
  ```
  https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=books&id=1440
  
  ```
  
  Dies on NBK1440 and removing NBK gives:
  
  ```
  <ERROR>UID=1440: cannot get document summary</ERROR>
  
  ```
  
  The values come from the (9Mb) ClinVar citations file: <https://ftp.ncbi.nlm.nih.gov/pub/clinvar/tab_delimited/var_citations.txt> - the first is from tihs line:
  
  ```
  15048   9   1800562     NCBIBookShelf   NBK1440
  
  ```
  
  **ANSWER**
  
  Thanks to arupgsh - yes the ClinVar citation\_id was a RID for bookshelf not an ID like it is for Pubmed and PMC. FYI my solution was:
  
  ```
  def get_summary_for_bookshelf_rid(bookshelf_rid):
      handle = Entrez.esearch(db="books", term=bookshelf_rid)
      search_results = Entrez.read(handle)
      handle = Entrez.esummary(db="books", id=','.join(search_results['IdList']))
      results = Entrez.read(handle)
  
      for r in results:
          if r["RID"] == bookshelf_rid:
              return r
  
      return None
  
  get_summary_for_bookshelf_rid("NBK1440")
  
  ```
  
  returns:
  
  ```
  {'PubDate': '2000/04/03 00:00', 'Title': 'HFE-Associated Hereditary Hemochromatosis', 'Text': '', 'RType': 'chapter', u'Id': '1475938', u'Item': [], 'Book': 'gene', 'Parents': '', 'RID': 'NBK1440', 'ID': 'gene/chapter/hemochromatosis/PMC'}
  
  ```
  
  **Tags:** api, data-retrieval
  
  > **Comments:**
  > **username_1**: But unlike PubMed article, there is no entry for abstracts for NCBI bookshelf.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2017-11-01. Score: 5 | Accepted answer
  
  Entrez requires the unique identifiers(UID) for fetching related info. The id you are using in the query is RID. I guess that why you are getting `<ERROR>UID=1440: cannot get document summary</ERROR>`.
  
  List of example uids using the term "ncbi+blast":
  
  <https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=books&term=ncbi+blast>
  
  Summary of the first item:
  
  <https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=books&id=4459608>
  
  Using the Entrez python package:
  
  ```
  from Bio import Entrez
  Entrez.email = "youremail@domain.com"
  handle = Entrez.esummary(db="books", id="4459608,4456634", retmode="xml")
  records = Entrez.parse(handle)
  for record in records:
       print(record['Title'])
  handle.close()
  
  ```
  
  I'm not sure about the availability of book abstracts.
  
  > **Comments:**
  > **username_0**: Thanks - yes the ClinVar citation_id was a RID for bookshelf not an ID like it is for Pubmed and PMC  
  
  ---
  
  ### Answer by username_2 on 2017-11-01. Score: 3
  
  As arupgsh says, you need to use esearch to get a list of unique identifiers before using efetch to retrieve info about each result. I think the easiest way to do this is to use [Entrez Direct](https://www.ncbi.nlm.nih.gov/books/NBK179288), which allows you to simply pipe esearch output to efetch:
  
  ```
  esearch -db books -query NBK1440 | efetch -format docsum
  
  ```
  
  or
  
  ```
  esearch -db books -query NBK1440 | esummary
  
  ```
  
  
  ---
  
  