查看他们的 API 文档并进行一些尝试,似乎您能做的最好的事情就是获取本书主题的列表,然后获取这些主题的类别。
因此,以他们为例,给定 ISBN 为 0061031321,您首先调用
http://isbndb.com/api/books.xml?access_key= $Z&results=subjects&index1=isbn&value1= 0061031321
返回
<BookData book_id="thief_of_time" isbn="0061031321" isbn13="9780061031328">
<Title>Thief of time</Title>
<TitleLong>Thief of time: a novel of Discworld</TitleLong>
<AuthorsText>Terry Pratchett</AuthorsText>
<PublisherText publisher_id="harpertorch">New York, N.Y. : HarperTorch, [2002], c2001.</PublisherText>
<Subjects>
<Subject subject_id="discworld_imaginary_place_fiction">Discworld (Imaginary place) -- Fiction</Subject>
<Subject subject_id="fantasy_fiction_aaaa0">Fantasy fiction</Subject>
</Subjects>
</BookData>
然后遍历主题,获取它们的类别:
http://isbndb.com/api/subjects.xml?access_key= $Z&results=categories&index1=subject_id&value1= discworld_imaginary_place_fiction
<...snip...>
<Categories>
<Category category_id="imaginary_places">Imaginary Places</Category>
<Category category_id="imaginary_places.discworld">Discworld</Category>
</Categories>
<...snip...>
http://isbndb.com/api/subjects.xml?access_key= $Z&results=categories&index1=subject_id&value1= Fantasy_fiction_aaaa0
<...snip...>
<Categories>
<Category category_id="genres.fantasy">Fantasy</Category>
</Categories>
<...snip...>
所以 ISBN 0061031321 的类别是:
categories.xml
如果您想获取整个类别层次结构,可以通过 api 跟踪这些。