Returns pricing metadata from Amazon and BetterWorldBooks for a given book. Requires either an `isbn` or `asin` query parameter.
(
isbn: Annotated[str | None, Query(description="ISBN-10 or ISBN-13", min_length=10, max_length=13)] = None,
asin: Annotated[str | None, Query(description="Amazon ASIN", min_length=10, max_length=10)] = None,
)
| 356 | description="Returns pricing data for a book from Amazon and BetterWorldBooks.", |
| 357 | ) |
| 358 | async def price_api( |
| 359 | isbn: Annotated[str | None, Query(description="ISBN-10 or ISBN-13", min_length=10, max_length=13)] = None, |
| 360 | asin: Annotated[str | None, Query(description="Amazon ASIN", min_length=10, max_length=10)] = None, |
| 361 | ) -> dict: |
| 362 | """ |
| 363 | Returns pricing metadata from Amazon and BetterWorldBooks for a given book. |
| 364 | Requires either an `isbn` or `asin` query parameter. |
| 365 | """ |
| 366 | if not (isbn or asin): |
| 367 | raise HTTPException( |
| 368 | status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, |
| 369 | detail="isbn or asin required", |
| 370 | ) |
| 371 | |
| 372 | return await get_price_data_async(isbn or "", asin or "") |
| 373 | |
| 374 | |
| 375 | class FollowEntry(BaseModel): |
nothing calls this directly
no test coverage detected