Dynamic Links
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Google 도서 동적 링크 기능을 사용하면 내 사이트에서 더욱 맞춤설정 가능하고 신뢰할 수 있는 Google 도서 링크를 만들 수 있습니다. 예를 들어 도서가 Google 색인에 포함되어 있을 때만 표시되는 '스마트' 링크를 생성할 수도 있고, Google 도서에서 책을 미리보기할 수 있는지 여부를 사용자에게 알려주는 링크를 표시할 수도 있습니다. 동적 링크 기능을 사용하면 Google 도서 링크에 썸네일 이미지를 포함할 수도 있습니다. 이 문서에서는 이 기능을 사이트에 빠르게 추가할 수 있습니다.
참고: 이 기능은 이전에는 Book Visibility API라고 했습니다.
미리보기 마법사는 동적 링크를 기반으로 구축된 도구로, 코드 몇 줄만 복사하면 사이트에서 도서 미리보기를 더욱 쉽게 연결할 수 있습니다. 이 문서는 도서 검색에 연결하는 방법을 맞춤설정하려는 고급 개발자를 대상으로 합니다.
목차
- 시청자층
- 도서 검색 용어
- 도입
- 브랜드 가이드라인
- 클라이언트 측 API
- 요청 URL 형식
- JSON 결과 형식
- 동기 및 비동기 모드
- 자주 묻는 질문(FAQ)
- 코드 샘플
시청자층
동적 링크 문서는 Google 도서 내의 책에 연결하는 웹 애플리케이션을 작성하려는 프로그래머를 위해 마련되었습니다. 이 문서에서는 사용자가 HTTP 프로토콜 및 기본 JavaScript에 익숙하다고 가정합니다.
도서 검색 용어
Google 도서는 사용자의 현지 저작권 제한을 존중하므로 일부 지역에서는 일부 도서의 미리보기 또는 전체 보기가 지원되지 않습니다. 조회 가능성은 다음 클래스로 클러스터링됩니다.
- 전체 화면
- 책 전체를 볼 수 있습니다. 이러한 도서는 공개 도메인에 속할 수 있습니다.
- 일부 미리보기
- 도서의 일부를 볼 수 있습니다. 이 책은 저작권 보호 대상이며 Google 도서에서 사용자가 이 페이지에 액세스할 수 있도록 허가를 받았습니다. 이 도서는 사용자가 전체 페이지를 볼 수 있다는 점에서 발췌문 보기 도서와 다릅니다.
- 스니펫 보기 및 미리보기 없음
- 사용자에게는 '도서 정보' 페이지만 표시됩니다. 최대 발췌문만 사용할 수 있습니다. 스캔되지 않았거나 저작권이 적용되는 책이며 Google 도서에서 사용자의 검색어와 관련된 '발췌문'을 몇 개 이상 노출할 권한을 받지 않았습니다.
소개
정적 링크 문서에서는 Google 도서의 특정 도서 페이지로 연결되는 URL을 생성하는 매우 간단한 방법을 설명합니다. 간혹 특정 도서가 Google 도서 색인에 없거나 특정 지역의 사용자가 미리보기를 사용할 수 없는 경우가 있습니다. 정적 링크는 '블라인드'이기 때문에 때로는 원하는 효과를 얻지 못할 수도 있습니다.
동적 링크는 JavaScript를 사용하여 책의 조회가능성을 쿼리하기 위한 프로그래매틱 방식의 클라이언트 측 대체 메서드를 제공합니다. 이를 통해 도서 검색에 보다 안정적이고 예측 가능한 링크를 포함하여 사용자에게 보다 일관된 환경을 제공할 수 있습니다. 조회가능성은 최종 사용자의 위치에 따라 달라지므로 동적 링크 인터페이스는 서버 측 또는 오프라인 쿼리에 맞게 설계되지 않았습니다.
동적 링크의 기능을 알아보려면 이 문서 마지막에 나오는 코드 샘플로 건너뛰세요.
브랜드 가이드라인
동적 링크를 렌더링할 때는 Google Books API 제품군에 적용되는 브랜드 가이드라인을 준수해야 합니다. 특히 인코더-디코더 아키텍처를
- Google 도서에 대한 저작자 표시 및 링크를 유지해야 합니다.
- Google 도서의 미리보기에 연결할 때는 승인된 Google 미리보기 버튼만 사용해야 합니다.
- 모든 텍스트 링크, 버튼, 문서 또는 설명 텍스트는 승인된 명명 규칙을 준수해야 합니다. 예를 들어 Google 도서 미리보기에 링크할 때 '다운로드' 또는 '읽기'라는 동사를 사용하면 안 됩니다. 공개 도메인 저작물만 전체 다운로드할 수 있기 때문입니다.
브랜딩 예
프리코노믹스: 불량 경제학자, 모든 것의 숨겨진 면을 탐구하다
작성자: Steven Levitt 및 Stephen Dubner
이 문서 끝에 있는 샘플 섹션에서 현재의 브랜드 가이드라인을 준수하는 추가 예를 확인할 수 있습니다.
클라이언트 측 API
클라이언트 측 동적 링크의 핵심은 개발자가 하나 이상의 도서에 대한 정보를 요청하는 URL을 구성하고 <script>
태그를 사용하여 Google 도서에 요청을 보낼 수 있는 URL 형식입니다.
- 구문 예:
<script src="https://books.google.com/books?bibkeys=ISBN:0451526538&jscmd=viewapi&callback=mycallback"></script>
URL 형식은 도서에 연결하는 데 사용되는 URL 구문과 유사하지만 도서 ID 필드에 쉼표로 구분된 도서 ID가 여러 개 포함될 수 있으며 추가 'jscmd' 및 'callback' 매개변수가 있습니다. 원하는 경우 조회가능성 필터를 제어하기 위한 추가 인수가 있을 수 있습니다.
동적 링크는 ISBN, OCLC 번호, LCCN 키 등 도서를 식별하는 여러 가지 방법을 지원합니다. API는 GET 요청의 최대 크기까지 일괄 쿼리를 허용합니다.
- ISBN
&bibkeys=ISBN:0451526538
(API는 ISBN 10 및 13을 모두 지원합니다.)
- OCLC
&bibkeys=OCLC:36792831
- 미국 국회도서관 제어번호(LCCN)
&bibkeys=LCCN:96072233
-
이 호출의 응답은 하나 이상의 JSON 객체로 반환되는 요청된 도서에 대한 정보입니다. JSON 객체는 다음과 같은 구조를 사용합니다.
JsonSearchResult {
string bib_key;
string info_url;
string preview_url;
string thumbnail_url;
string preview;
};
이러한 필드는 다음 정보를 제공합니다.
- bib_key
- 이 책을 쿼리하는 데 사용되는 식별자입니다.
- info_url
- 책에 관한 정보가 있는 Google 도서 페이지 (도서 정보 페이지)의 URL입니다.
- preview_url
- 도서 미리보기 URL로, 사용자가 책 표지로 바로 이동할 수 있습니다. 요청에 대해 발췌문 보기 또는 미리보기 도서만 사용할 수 있는 경우 미리보기 URL이 반환되지 않습니다.
- thumbnail_url
- 책 표지 썸네일의 URL입니다.
- 프리뷰
- 책의 조회가능성 상태를 나타내는 값으로,
full
(전체보기 도서), partial
(제한된 미리보기 도서의 경우), noview
(스니펫 또는 미리보기 없음)입니다.
- 삽입 가능
- 도서 검색에 삽입된 뷰어를 사용하여 타사 페이지에 도서를 삽입할 수 있는 경우 이 불리언은
true
입니다.
응답은 두 개의 필드가 있는 JSON 객체입니다. 'books' 필드에는 도서 객체의 맵 값이 있고 'options'에는 해당 요청에 사용 설정된 옵션 목록이 포함되어 있습니다. 옵션이 지정되지 않은 경우 "options" 필드는 응답에서 생략될 수 있습니다. 예를 들면 다음과 같습니다.
Request:
https://books.google.com/books?jscmd=viewapi&bibkeys=0596000278,00-invalid-isbn,ISBN0765304368,0439554934&callback=ProcessGBSBookInfo
Response:
ProcessGBSBookInfo({
"0596000278":{
"bib_key":"0596000278",
"info_url":"https://books.google.com/books?id=ezqe1hh91q4C&source=gbs_ViewAPI",
"preview_url":"https://books.google.com/books?id=ezqe1hh91q4C&printsec=frontcover&sig=zSQ5gwlX1NZl_24M86KS8Rbj33Q&source=gbs_ViewAPI",
"thumbnail_url":"https://books.google.com/books?id=ezqe1hh91q4C&pg=PR3&img=1&zoom=5&sig=bBmzIAIiCtMcM7Ii7TUHycqqEWg",
"preview":"partial"
},
"ISBN0765304368":{
"bib_key":"ISBN0765304368",
"info_url":"https://books.google.com/books?id=gfg13CM_kU8C&source=gbs_ViewAPI",
"preview_url":"https://books.google.com/books?id=gfg13CM_kU8C&printsec=frontcover&sig=jIrSb_SkcQRhy_VvtnKbTXjmvos&source=gbs_ViewAPI",
"thumbnail_url":"https://books.google.com/books?id=gfg13CM_kU8C&pg=PP1&img=1&zoom=5&sig=LsTwGVAsy_qWYMPM6HVDTPAMokg",
"preview":"full"
},
"0439554934":{
"bib_key":"0439554934",
"info_url":"https://books.google.com/books?id=iwiYGwAACAAJ&source=gbs_ViewAPI",
"preview_url":"https://books.google.com/books?id=iwiYGwAACAAJ&source=gbs_ViewAPI",
"thumbnail_url":"https://books.google.com/books?id=iwiYGwAACAAJ&printsec=frontcover&img=1&zoom=5&sig=_L6ySKDAs-8gNK28c3NyFdO22ZM",
"preview":"noview"}
});
그런 다음 개발자는 GBS 서버에서 가져온 JSON 결과에 따라 웹페이지의 콘텐츠와 모양을 변경할 수 있습니다. 현재 GBS는 이를 위해 DOM을 수정하는 라이브러리를 제공하지 않습니다.
매개변수 및 추가 필드
- jscmd
- Google 도서에 대한 요청입니다.
- callback
- 반환을 전달할 JavaScript 함수의 이름입니다.
동기 모드와 비동기 모드 비교
비동기 모드
비동기 모드에서 개발자는 <script>
태그를 문서의 <head>
에 배치하고 페이지를 렌더링하는 데 필요한 모든 식별자가 포함된 URL을 구성합니다. 데이터는 변수의 호출에서 수신됩니다. 이렇게 하면 문서의 나머지 부분에서 책의 정보를 사용할 수 있으며 HTML 및 자바스크립트에서 즉시 액세스할 수 있습니다.
동기 모드
동기 모드에서는 개발자가 HTML <body>
중간에 있는 URL을 사용합니다. 응답은 JavaScript 콜백을 사용하여 처리됩니다.
자주 묻는 질문(FAQ)
- Q: 동적 링크를 사용하려면 API 키 또는 기타 권한이 필요한가요?
- A: 동적 링크를 사용하는 데는 API 키나 다른 승인이 필요하지 않습니다. 시작하려면 예시 중 하나를 복사하여 붙여넣고 수정해 보세요.
- Q: 자바스크립트를 지원하지 않거나 사용 중지된 브라우저는 어떻게 되나요?
- A: 사용자 브라우저에 JavaScript가 사용 설정되어 있지 않으면 Google 도서에 책이 있는지 테스트할 수 없습니다. JavaScript가 없는 브라우저의 경우 Google 도서의 정적 링크 구조를 사용하는 것이 좋지만 Google 도서에 링크하려는 도서가 있는지 미리 알 수는 없습니다.
- Q: 한 번에 몇 권의 도서를 검색할 수 있나요?
- A: 검색할 수 있는 도서의 수는 GET 요청의 길이에 의해서만 제한됩니다. Microsoft Internet Explorer에서는 최대 URL 길이 (2,083자)가 GET 요청의 길이를 제한합니다.
- Q: Google 도서에서 조금 전에 도서 검색결과를 반환했습니다. 지금은 결과가 표시되지 않는 이유는 무엇인가요?
- A: 개발자는 종종 이례적인 양의 요청을 내리기 때문에 실수로 Google 도서에 안내된 보안 예방 조치를 알려 줄 수 있습니다. 이를 확인하려면 API에서 반환하는 내용을 확인하세요. 보안문자 입력을 요청하는 경우 너무 많은 검색을 실행한 것입니다. Google 도서에 로그인한 후 다시 시도해 보세요.
- Q: 개인 정보 보호는 어떻게 되나요?
- A: 도서 조회가능성에 대한 쿼리에 답변할 때 Google은 개인 식별이 불가능한 서버 로그 데이터를 수신합니다. Google은 사용자 개인 정보 보호를 매우 중요하게 여기며, 이 데이터는 개인정보처리방침에 설명된 대로 취급합니다. 도서 조회가능성이 포함된 서비스를 사용자에게 제공하는 경우, 서비스에서 동적 링크를 통해 Google에 검색어를 제출한다는 점을 사용자에게 알려야 합니다.
코드 샘플
이 섹션에서는 동적 링크를 사용하는 다양한 방법을 보여주는 샘플을 제공합니다. 예시를 클릭하면 실제 동작을 확인할 수 있습니다. 기본 코드를 보려면 브라우저에서 '소스를 확인'하세요.
- 도서 페이지의 미리보기 버튼
동적 링크를 사용하여 사이트의 개별 도서 페이지에 '미리보기' 버튼을 추가하려는 경우에 적합한 예입니다. 이 구현에서는 Google 도서에 대한 동기 호출을 사용합니다.
- 과정 읽기 목록
이 예는 교육 과정의 일반적인 도서 목록을 보여줍니다. Google에서는 단일 동기 호출을 사용하여 Google 도서의 페이지를 예약하고 표지 이미지를 추가하며 미리보기 사용 가능 여부를 표시합니다.
- 대체 도서 목록
앞의 예와 마찬가지로 이 샘플에서는 비동기 API 콜백을 사용하여 도서 검색에 링크를 추가합니다.
- 대화형 AJAX
대화형 AJAX 애플리케이션에서 동적 링크를 사용하는 데 관심이 있을 수 있습니다. 이 예에서는 페이지를 새로고침하지 않고 여러 호출을 실행하는 방법을 보여줍니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-06-28(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2024-06-28(UTC)"],[[["\u003cp\u003eGoogle Books Dynamic Links offer customizable and reliable links to Google Books, enhancing user experience by displaying links based on book availability and preview options.\u003c/p\u003e\n"],["\u003cp\u003eDynamic Links utilize a client-side JavaScript API allowing developers to verify book viewability and retrieve information like thumbnail URLs and preview states before rendering links.\u003c/p\u003e\n"],["\u003cp\u003eWhen integrating Dynamic Links, developers must adhere to Google Books branding guidelines, including proper attribution, approved button usage, and consistent naming conventions.\u003c/p\u003e\n"],["\u003cp\u003eThe API supports batched queries using various book identifiers (ISBN, OCLC, LCCN) and returns results in JSON format containing details like preview URLs, thumbnail URLs, and viewability status.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers have access to a Preview Wizard tool for simplified integration and code generation, along with detailed documentation and code samples for advanced customization.\u003c/p\u003e\n"]]],[],null,["# Dynamic Links\n\nThe Google Books Dynamic Links feature allows you to create more customizable, reliable links to Google Books from your site. For example, this tool lets you generate \"smart\" links that appear only when a book is in our index, or display links that indicate to your users whether a book can be previewed on Google Books. The Dynamic Links feature also lets you include a thumbnail image in your link to Google Books. This document is intended to let you quickly add this functionality to your site.\n\n*Note: This feature was formerly known as the the Book Viewability API.*\n\nThe [Preview Wizard](/books/docs/preview-wizard) is a tool built atop Dynamic Links that makes it even easier to link to book previews from site by just copying a few lines of code. This document is intended for more advanced developers looking to customize how they link to Book Search.\n\nContents\n--------\n\n1. [Audience](#audience)\n2. [Book Search terminology](#terminology)\n3. [Introduction](#introduction)\n4. [Branding guidelines](#style-guide)\n5. [The Client-side API](#clientSide)\n6.\n 1. [Request URL format](#requestFormat)\n 2. [JSON results format](#JSONformat)\n7. [Synchronous and asynchronous modes](#syncAsync)\n8. [Frequently asked questions](#faq)\n9. [Code samples](#htmlEx)\n\nAudience\n--------\n\nThe dynamic links documentation is intended for programmers who want to write web applications that link to books within Google Books. This documentation assumes that you are familiar with the HTTP protocol and basic JavaScript.\n\nBook Search terminology\n-----------------------\n\nGoogle Books respects the user's local copyright restrictions, and as a result, previews or full views of some books are not available in all locations. Viewability is clustered into the following classes:\n\nFull View\n: The entire book is viewable. These books may be in the public domain.\n\nLimited Preview\n: A portion of the book is viewable. This book is under copyright and Google Books has received permission to make these pages accessible to users. These books differ from Snippet View books in that users may view entire pages.\n\nSnippet View and No Preview\n: Users see only an \"About the book\" page. At most, only short excerpts from the book are available. This book has either not been scanned, or is under copyright and Google Books has not received permission to expose more than a few \"snippets\" related to a user's search term.\n\nIntroduction\n------------\n\nThe [Static Links](/books/docs/static-links) documentation describes a very simple way of generating URLs to a particular book's page on Google Books. Unfortunately, it is sometimes the case that a particular book is not in the Google Books index, or that a preview is not available to a user in a particular geographic location. Because Static Links are \"blind,\" they sometimes fail to have the intended effect.\n\nDynamic Links provides an alternative, programmatic client-side method for querying the viewability of a book using JavaScript. This allows you to include more reliable and predictable links to Book Search, leading to a more consistent experience for your users. Because viewability varies according to the end user's location, the dynamic link interface is not designed for server-side or offline queries.\n\nTo get a sense of what Dynamic Links can do, skip to the [code samples](#htmlEx) at the end of this document.\n\nBranding guidelines\n-------------------\n\nWhen rendering Dynamic Links, you must abide by the [branding guidelines](/books/branding) that govern the Google Books API Family. In particular,\n\n- You must maintain attribution and links to Google Books.\n- You must use only the approved [Google Preview button](/books/branding#previewbutton) when linking to previews on Google Books.\n- Any text links, buttons, documentation, or descriptive text should abide by the approved [naming conventions](/books/branding#naming). For example, you should not use the verbs \"download\" or \"read\" when linking to Google Books previews, as only public domain works can be downloaded in their entirety.\n\n\u003cbr /\u003e\n\n### Example branding\n\n**Freakonomics: An Rogue Economist Explores the Hidden Side of Everything** \nBy Steven Levitt and Stephen Dubner\n\n[](https://books.google.com/books?id=LkQPOSXMUscC&printsec=frontcover) \n\n\nThe [samples section](#htmlEx) at the end of this document provides additional examples that are compliant with the current branding guidelines.\n\nClient-side API\n---------------\n\nAt the core of the client-side dynamic link is a URL format that allows developers to construct URLs requesting information on one or more books and send the requests to Google Books using the `\u003c``script\u003e` tag.\n\nSyntax Example:\n: ` \u003c``script src=\"https://books.google.com/books?bibkeys=ISBN:0451526538&jscmd=viewapi&callback=mycallback\"\u003e\u003c``/script\u003e`\n\n### Request format\n\nThe format of the URL is similar to the URL syntax [used to link to books](https://books.google.com/support/bin/answer.py?answer=80658), but the book ID field may contain multiple comma separated book IDs and there are additional 'jscmd' and 'callback' parameters. Optionally, additional arguments can be present to control the viewability filters.\n\nDynamic Links supports several different methods for identifying books: ISBNs, OCLC numbers, and LCCN keys. The API allows batched queries of up to the size of the max size of a GET request.\n\nISBN\n: `&bibkeys=ISBN:0451526538` (The API supports both ISBN 10 and 13.)\n\nOCLC\n: `&bibkeys=OCLC:36792831`\n\nLCCN\n: `&bibkeys=LCCN:96072233`\n:\n\n\u003cbr /\u003e\n\n### JSON results format\n\nThe response from this call will be information about the requested books returned as one or more JSON objects. The JSON objects use the following structure: \n\n```\nJsonSearchResult {\n string bib_key;\n string info_url;\n string preview_url;\n string thumbnail_url;\n string preview;\n};\n```\n\nThese fields provide the following information:\n\nbib_key\n: The identifier used to query this book.\n\ninfo_url\n: A URL to a page within Google Books with information on the book (the about this book page).\n\npreview_url\n: A URL to the preview of the book, which takes the user directly to the cover of the book. If only Snippet View or No Preview books available for a request, no preview URL will be returned.\n\nthumbnail_url\n: A URL to a thumbnail of the cover of the book.\n\npreview\n: A value indicating the [viewability state](#terminology) of the book: `full` (for Full View books), `partial` (for Limited Preview books), or `noview` (for Snippet or No Preview books).\n\nembeddable\n: This boolean is `true` if the book can be embedded onto third party pages using the Book Search [embedded viewer](/books/docs/viewer/developers_guide)."]]