Query your reading library, book metadata, and search Hardcover's catalog.
HARDCOVER_API_TOKEN from https://hardcover.app/settingshttps://api.hardcover.app/v1/graphqlAll queries require Authorization: Bearer {token} header (token from settings, add Bearer prefix):
curl -X POST https://api.hardcover.app/v1/graphql \
-H "Authorization: Bearer $HARDCOVER_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"query": "query { me { id username } }"}'
```graphql
query { me { id username } }
```
status_id filter:1 = Want to Read2 = Currently Reading 3 = Read4 = Paused5 = Did Not Finishlimit/offset, add distinct_on: book_idquery {
me {
user_books(where: { status_id: { _eq: 2 } }) {
user_book_reads { progress_pages }
book {
title
pages
image { url }
contributions { author { name } }
}
}
}
}
query ($userId: Int!, $status: Int!) {
user_books(
where: { user_id: { _eq: $userId }, status_id: { _eq: $status } }
limit: 25
offset: 0
distinct_on: book_id
) {
book {
id
title
pages
image { url }
contributions { author { name } }
}
}
}
query ($q: String!, $type: String!) {
search(query: $q, query_type: $type, per_page: 10, page: 1) {
results
}
}
query_type: Book, Author, Series, Character, List, Publisher, User
query {
editions(where: { title: { _eq: "Oathbringer" } }) {
title
pages
isbn_13
edition_format
publisher { name }
book {
slug
contributions { author { name } }
}
}
}
_like, _ilike, _regex)For detailed field documentation on Books, Editions, Authors, Series, User Books, Activities, Lists, Goals, and other entities, see references/entities.md.
| Code | Meaning |
|---|---|
| ------ | --------- |
| 200 | Success |
| 401 | Invalid/expired token |
| 429 | Rate limited |
共 1 个版本