Search Inside API fetch request authorization #10437
Labels
Lead: @cdrini
Issues overseen by Drini (Staff: Team Lead & Solr, Library Explorer, i18n) [managed]
Needs: Community Discussion
This issue is to be brought up in the next community call. [managed]
Priority: 3
Issues that we can consider at our leisure. [managed]
Theme: Public APIs
Issues related to APIs accessible to external parties. [managed]
Type: Question
This issue doesn't require code. A question needs an answer. [managed]
Question
After following the Search Inside API following the documentation on the Open Library website here for a personal project for education purposes, most responses return a 403 error due to CORS policy - are there any options/headers currently set to be able to make use of this, similar to using the S3 Authentication for item metadata, for example?
Additional context
For example, a fetch request for The fellowship of the ring using the following URL returns an error due to CORS policy (search for "gandalf" inside of the text): https://ia903204.us.archive.org/fulltext/inside.php?item_id=fellowshipofring0001tolk&doc=fellowshipofring0001tolk&path=/34/items/fellowshipofring0001tolk&q=%22gandalf%22
However, an open source version of this book returns the request successfully using the same search query and the following link in the request: https://ia601003.us.archive.org/fulltext/inside.php?item_id=j-r-r-tolkien-lord-of-the-rings-01-the-fellowship-of-the-ring-retail-pdf&doc=j-r-r-tolkien-lord-of-the-rings-01-the-fellowship-of-the-ring-retail-pdf&path=/3/items/j-r-r-tolkien-lord-of-the-rings-01-the-fellowship-of-the-ring-retail-pdf&q=%22gandalf%22
Another open source book was tested, but returned the following error: "No hOCR or Abbyy file present", despite a 'HOCR' file being listed in the download options on the web page, as well as in the files property of the metadata.
Issue resolution criteria
Clarification on the limitations of using the Search Inside API: if it's possible to use this with additional authentication for books currently returning an error due to CORS, or if it's only possible to be used on publications in the 'opensource' collection. Clarification if the "No hOCR or Abbyy file present" is correct, or if there is a different file/format that needs to be provided.
Stakeholders
The text was updated successfully, but these errors were encountered: