The archive.org lending endpoint to create a new loan accepts one of two values for the "action" parameter: borrow_book or browse_book. borrow_book attempts to initiate a 14-day loan. browse_book attempts to initiate a 1-day loan. As it stands, there is no automatic fallback, so if you request a borrow, but only browse is available, you will get an error instead of a loan.
You can tell whether a book can be borrowed or browsed by the corresponding lending status fields "available_to_borrow" or "available_to_browse." These are stored in the search engine (but not in meta.xml) as lending___available_to_borrow and lending___available_to_browse. They may be reflected in the bulk availability API -- not sure. They are definitely reflected in the singular /services/loans/loan/?action=availability API.
openlibrary/openlibrary/book_providers.py
Line 240 in ded8118
The archive.org lending endpoint to create a new loan accepts one of two values for the "action" parameter: borrow_book or browse_book. borrow_book attempts to initiate a 14-day loan. browse_book attempts to initiate a 1-day loan. As it stands, there is no automatic fallback, so if you request a borrow, but only browse is available, you will get an error instead of a loan.
You can tell whether a book can be borrowed or browsed by the corresponding lending status fields "available_to_borrow" or "available_to_browse." These are stored in the search engine (but not in meta.xml) as lending___available_to_borrow and lending___available_to_browse. They may be reflected in the bulk availability API -- not sure. They are definitely reflected in the singular /services/loans/loan/?action=availability API.