developer tip

바코드 번호에서 책에 대한 데이터를 조회하려면 어떻게해야합니까?

optionbox 2020. 11. 2. 07:52
반응형

바코드 번호에서 책에 대한 데이터를 조회하려면 어떻게해야합니까?


저는 세계에서 가장 간단한 라이브러리 응용 프로그램을 만들고 있습니다. 내가 할 수있는 일은 일반적인 스캐너 (바코드 번호를 필드에 입력)를 사용하여 책의 UPC (바코드)에서 스캔 한 다음이를 사용하여 책에 대한 데이터를 찾는 것입니다. 최소, 제목, 저자, 출판 연도 및 듀이 십진수 또는 의회 도서관 카탈로그 번호.

목표는 책의 등뼈에 붙일 수있는 카드 카탈로그 번호가있는 작은 스티커 ( "등뼈 레이블")를 인쇄 한 다음 회사 도서관의 선반에있는 카드 카탈로그 번호로 책을 정렬하는 것입니다. 이렇게하면 비슷한 주제에 대한 책이 서로 가까이있는 경향이 있습니다. 예를 들어 회계에 관한 책을 찾고 있다는 것을 알고 있다면 회계에 관한 책을 찾아 내면 나머지 6 개를 볼 수 있습니다. 바로 옆에있어 라이브러리를 편리하게 탐색 할 수 있습니다.

Amazon과 의회 도서관을 포함하여이를 수행하는 웹 API가 많이있는 것 같습니다. 그러나 그것들은 모두 저에게 매우 혼란 스럽습니다. 내가 정말로 원하는 것은 UPC 바코드 번호를 가져 와서 책에 대한 몇 가지 기본 데이터를 반환하는 단일 상위 수준 함수입니다.


ISBNDB.com에는 매우 간단한 웹 기반 솔루션이 있습니다.

편집 : 업데이트 된 API 문서 링크, 이제 버전 2도 사용할 수 있습니다.

여기에 가격 및 등급 링크

단 몇 분 만에 시작하고 실행할 수 있습니다 (이 예제는 API v1에서 가져온 것입니다).

  • 사이트에 등록하고 API 사용을위한 키 받기
  • 다음과 같은 URL을 시도하십시오.

    http://isbndb.com/api/books.xml?access_key={yourkey}&index1=isbn&results=details&value1=9780143038092

results = details는 카드 카탈로그 번호를 포함한 추가 세부 정보를 가져옵니다.

제쳐두고, 일반적으로 바코드는 isbn10 또는 isbn13의 isbn입니다. 스캐너를 사용하고 18 개의 숫자를 선택하는 경우 마지막 5 개의 숫자 만 삭제하면됩니다.

다음은 샘플 응답입니다.

<ISBNdb server_time="2008-09-21T00:08:57Z">
  <BookList total_results="1" page_size="10" page_number="1" shown_results="1">
    <BookData book_id="the_joy_luck_club_a12" isbn="0143038095">
      <Title>The Joy Luck Club</Title>
      <TitleLong/>
      <AuthorsText>Amy Tan, </AuthorsText>
      <PublisherText publisher_id="penguin_non_classics">Penguin (Non-Classics)</PublisherText>
      <Details dewey_decimal="813.54" physical_description_text="288 pages" language="" edition_info="Paperback; 2006-09-21" dewey_decimal_normalized="813.54" lcc_number="" change_time="2006-12-11T06:26:55Z" price_time="2008-09-20T23:51:33Z"/>
    </BookData>
  </BookList>
</ISBNdb>

참고 : 저는 LibraryThing 사람이므로 부분적인 자체 홍보입니다.

주어진 ISBN에 대한 데이터를 얻는 몇 가지 좋은 방법을 다루는 이 StackOverflow 답변을 살펴보십시오 .

문제에 대해 Amazon은 간단한 DDC (Dewey)를 포함합니다. Google은 그렇지 않습니다. WorldCat API는 작동하지만이를 사용하려면 OCLC 라이브러리 여야합니다.

ISBN / UPC 문제는 복잡합니다. 찾을 수있는 경우 ISBN을 선호합니다. 대중 시장 문고판은 때때로 외부에 UPC를, 내부에 ISBN을 표시합니다.

LibraryThing 회원은이 문제에 대한 몇 페이지를 작성하고 두 페이지를 매핑하기위한 노력을 기울였습니다.

Borders에서 구입하는 경우 책의 바코드는 모두 자체 내부 바코드 ( "BINC"라고 함)로 스티커가 부착됩니다. 가장 짜증나게도 그들이 사용하는 접착제는 시간이 지남에 따라 깨끗하게 제거하기가 점점 더 어려워집니다. 나는 그들을 변환하는 API가 없다는 것을 알고 있습니다. LibraryThing은 스크린 스크래핑을 통해이를 수행합니다.

API의 경우 Amazon을 사용합니다. LibraryThing은 좋은 비 API 옵션으로, BINC를 해결하고 "저작물"의 다른 버전을 살펴보면서 DDC 및 LCC가없는 도서에 대한 DDC 및 LCC를 추가합니다.

빠진 것은 라벨 부분입니다. 누군가가이를 위해 좋은 PDF 템플릿을 만들어야합니다.


편집 ISBN이 있으면 꽤 쉬울 것입니다. 하지만 UPC에서 ISBN으로 변환하는 것은 원하는만큼 쉽지 않습니다.

http://isbn.nu의 자바 스크립트 코드가 여기 에 있습니다.

if (indexisbn.indexOf("978") == 0) {
   isbn = isbn.substr(3,9);
   var xsum = 0;
   var add = 0;
   var i = 0;
   for (i = 0; i < 9; i++) {
        add = isbn.substr(i,1);
        xsum += (10 - i) * add;
   }
   xsum %= 11;
   xsum = 11 - xsum;
   if (xsum == 10) { xsum = "X"; }
   if (xsum == 11) { xsum = "0"; }
   isbn += xsum;
}

However, that only converts from UPC to ISBN some of the time.

You may want to look at the barcode scanning project page, too - one person's journey to scan books.

So you know about Amazon Web Services. But that assumes amazon has the book and has scanned in the UPC.

You can also try the UPCdatabase at http://www.upcdatabase.com/item/{UPC}, but this is also incomplete - at least it's growing..

The library of congress database is also incomplete with UPCs so far (although it's pretty comprehensive), and is harder to get automated.

Currently, it seems like you'd have to write this yourself in order to have a high-level lookup that returns simple information (and tries each service)


Sounds like the sort of job one might get a small software company to do for you...

More seriously, there are services that provide an interface to the ISBN catalog, www.literarymarketplace.com.

On worldcat.com, you can create a URL using the ISBN that will take you straight to a book detail page. That page isn't as very useful because it's still HTML scraping to get the data, but they have a link to download the book data in a couple "standard" formats.

For example, their demo book: http://www.worldcat.org/isbn/9780060817084 Has a "EndNote" format download link http://www.worldcat.org/oclc/123348009?page=endnote&client=worldcat.org-detailed_record, and you can harvest the data from that file very easily. That's linked from their own OCLC number, not the ISBN, but the scrape to convert that isn't hard, and they may yet have a good interface to do it.


My librarian wife uses http://www.worldcat.org/, but they key off ISBN. If you can scan that, you're golden. Looking at a few books, it looks like the UPC is the same or related to the ISBN.

Oh, these guys have a function for doing the conversion from UPC to ISBN.


Using the web site Library Thing, you can scan in your barcodes (the entire barcode, not just the ISBN - if you have a scanning "wedge" you're in luck) and build your library. (It is an excellent social network - think StackOverflow for book enthusiasts.)

Then, using the TOOLS section, you can export your library. Now you have a text file to import/parse and can create your labels, a card catalog, etc.


I'm afraid the problem is database access. Companies pay to have a UPC assigned and so the database isn't freely accessible. The UPCdatabase site mentioned by Philip is a start, as is UPCData.info, but they're user entered--which means incomplete and possibly inaccurate.

You can always enter in the UPC to Google and get a hit, but that's not very automated. But it does get it right most of the time.

I thought I remembered Jon Udell doing something like this (e.g., see this), but it was purely ISBN based.

Looks like you've found a new project for someone to work on!


If you're wanting to use Amazon you can implement it easily with LINQ to Amazon.


Working in the library world we simply connect to the LMS pass in the barcode and hey presto back comes the data. I believe there are a number of free LMS providers - Google for "open source lms".

Note: This probably works off ISBN...


You can find a PHP implemented ISBN lookup tool at Dawson Interactive.


I frequently recommend using Amazon's Product Affiliate API (check it out here https://affiliate-program.amazon.com), however there are a few other options available as well.

If you want to guarantee the accuracy of the data, you can go with the a paid solution. GS1 is the organization that issues UPC codes, so their information should always be accurate (https://www.gs1us.org/tools/gs1-company-database-gepir).

There are also a number of third party databases with relevant information such as https://www.upccodesearch.com/ or https://www.upcdatabase.com/ .


Nothing like an answer nearly 5 years after the fact, but here's my couple of shiny pennies worth.

I'm currently building something that would do the job just nicely... https://blinked.in - what is fast becoming the largest UPC / EAN13 barcode database (we've added over 7M barcodes in the last week alone), whilst we're still in the alpha stage of development we're introducing a very straightforward, low cost API to provide just this sort of data access.

We've only been in dev for a couple of months, but already have a stable web platform, rapidly expanding database and desire to keep things simple.

Hope this helps you, or some future reader, in some way.

Updated

Our API is now live - https://blinked.in/api - and we've thrown in a 100 free calls per day, and you can earn credit from helping us discover new barcodes - https://blinked.in/bandwidthaccount

참고URL : https://stackoverflow.com/questions/106963/how-can-i-lookup-data-about-a-book-from-its-barcode-number

반응형