<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Interrogazione API Google Books - dati mancanti]]></title><description><![CDATA[<p dir="auto">Ciao a tutti!</p>
<p dir="auto">Sto lavorando ad un progetto per la catalogazione dei libri che abbiamo a casa e sto cercando di usufruire delle API di Google Books per ricavare i dettagli di ogni libro tramite il codice ISBN.</p>
<p dir="auto">Nel particolare, tramite VBA interrogo le API e faccio il parsing del risultato JSON per trasformarlo in un normale dizionario che posso consultare per popolare i vari campi. A livello di procedura nessun problema, tuttavia ho notato che i risultati che ricavo con l'API sono solo parziali e mancano di informazioni essenziali, nella maggior parte dei casi non ho trovato la casa editrice per esempio.</p>
<p dir="auto">Il mio codice é quello che segue (VBA):</p>
<pre><code>Sub GoogleBooksAPI()

#''//// Extract Details from Google Books API Based on ISBN ////''
#'' Author: Toti Pappalardo
#'' Date: 20/07/2020
#'' Last Update: 21/11/2020

Dim xml_obj As MSXML2.XMLHTTP60

Set xml_obj = New MSXML2.XMLHTTP60

base_url = "https://www.googleapis.com/books/v1/volumes?q=isbn:"
ISBN = Sheets("Inserimento").Range("ISBN").Value #Viene preso dalla cella di riferimento nel foglio Excel

#''Controllo che il campo ISBN non sia vuoto
If ISBN = "" Then
    MsgBox ("Inserire un ISBN valido")
    Exit Sub
End If

api_url = base_url &amp; ISBN

xml_obj.Open bstrMethod:="GET", bstrURL:=api_url
xml_obj.Send

Debug.Print "Request Code: " &amp; CStr(xml_obj.Status)
Debug.Print xml_obj.responseText

Dim Json As Object
Dim result As Dictionary
Dim Val As Variant
Dim Val2 As Dictionary

Dim Title, Subtitle, Author, Publisher, PubDate, Pages, Descr, Ctgr, img_url As String

Set Json = JsonConverter.ParseJson(xml_obj.responseText)


For Each result In Json("items")
    Title = result("volumeInfo")("title")
    Debug.Print Title
    Subtitle = result("volumeInfo")("subtitle")
    For Each Val In result("volumeInfo")("authors")
        Author = Author &amp; Val &amp; ", "
    Next
    Author = Left(Author, Len(Author) - 2)
    Publisher = result("volumeInfo")("publisher")
    PubDate = result("volumeInfo")("publishedDate")
    Pages = result("volumeInfo")("pageCount")
    Descr = result("volumeInfo")("description")
    img_url = result("volumeInfo")("imageLinks")("smallThumbnail")
Next

#'************** Creazione Userform con label dinamiche ***************'
With Results_Form
    .Title.Caption = Title
    .Subtitle.Caption = Subtitle
    .Author.Caption = Author
    .Publisher.Caption = Publisher
    .Pub_Date.Caption = PubDate
    .Pages.Caption = Pages
    .Excerpt.Caption = Descr
    .Cover_img.Navigate img_url
End With

Results_Form.Show

End Sub
</code></pre>
<p dir="auto">La procedura va a buon fine, ma come dicevo non tutti i parametri vengono popolati.</p>
<p dir="auto">Esempio pratico:</p>
<p dir="auto">Il codice ISBN 9788856658781 corrisponde al libro "Una Perfetta Sconosciuta", che su Google Books si trova a <a href="https://books.google.at/books?id=IBoIMQAACAAJ&amp;dq=una%20perfetta%20sconosciuta&amp;source=gbs_book_other_versions" rel="nofollow ugc">questa pagina</a></p>
<p dir="auto">Il JSON che ricevo dalla chiamata API con il parametro "isbn:9788856658781" é questo:</p>
<pre><code>{
  "kind": "books#volumes",
  "totalItems": 1,
  "items": [
    {
      "kind": "books#volume",
      "id": "IBoIMQAACAAJ",
      "etag": "15Q4/Obi0+k",
      "selfLink": "https://www.googleapis.com/books/v1/volumes/IBoIMQAACAAJ",
      "volumeInfo": {
        "title": "Una perfetta sconosciuta",
        "authors": [
          "Alafair Burke"
        ],
        "publishedDate": "2017-03-14",
        "industryIdentifiers": [
          {
            "type": "ISBN_10",
            "identifier": "885665878X"
          },
          {
            "type": "ISBN_13",
            "identifier": "9788856658781"
          }
        ],
        "readingModes": {
          "text": false,
          "image": false
        },
        "pageCount": 380,
        "printType": "BOOK",
        "categories": [
          "Fiction"
        ],
        "maturityRating": "NOT_MATURE",
        "allowAnonLogging": false,
        "contentVersion": "preview-1.0.0",
        "panelizationSummary": {
          "containsEpubBubbles": false,
          "containsImageBubbles": false
        },
        "imageLinks": {
          "smallThumbnail": "http://books.google.com/books/content?id=IBoIMQAACAAJ&amp;printsec=frontcover&amp;img=1&amp;zoom=5&amp;source=gbs_api",
          "thumbnail": "http://books.google.com/books/content?id=IBoIMQAACAAJ&amp;printsec=frontcover&amp;img=1&amp;zoom=1&amp;source=gbs_api"
        },
        "language": "it",
        "previewLink": "http://books.google.at/books?id=IBoIMQAACAAJ&amp;dq=isbn:9788856658781&amp;hl=&amp;cd=1&amp;source=gbs_api",
        "infoLink": "http://books.google.at/books?id=IBoIMQAACAAJ&amp;dq=isbn:9788856658781&amp;hl=&amp;source=gbs_api",
        "canonicalVolumeLink": "https://books.google.com/books/about/Una_perfetta_sconosciuta.html?hl=&amp;id=IBoIMQAACAAJ"
      },
      "saleInfo": {
        "country": "AT",
        "saleability": "NOT_FOR_SALE",
        "isEbook": false
      },
      "accessInfo": {
        "country": "AT",
        "viewability": "NO_PAGES",
        "embeddable": false,
        "publicDomain": false,
        "textToSpeechPermission": "ALLOWED",
        "epub": {
          "isAvailable": false
        },
        "pdf": {
          "isAvailable": false
        },
        "webReaderLink": "http://play.google.com/books/reader?id=IBoIMQAACAAJ&amp;hl=&amp;printsec=frontcover&amp;source=gbs_api",
        "accessViewStatus": "NONE",
        "quoteSharingAllowed": false
      }
    }
  ]
}
</code></pre>
<p dir="auto">Dove chiaramente mancano casa editrice e Trama che sono invece presenti sulla piattaforma.</p>
<p dir="auto">Qualcuno ha esperienze in merito e sa darmi informazioni su possibili soluzioni?</p>
<p dir="auto">Scusatemi se sono stato troppo lungo e GRAZIE se siete arrivati fin quaggiú a leggere <img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=12b9555a9a1" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:1.4em;width:auto;vertical-align:middle" title=":)" alt="🙂" /></p>
]]></description><link>https://dev.connect.gt/topic/243823/interrogazione-api-google-books-dati-mancanti</link><generator>RSS for Node</generator><lastBuildDate>Wed, 25 Nov 2026 21:27:37 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/243823.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 21 Nov 2020 00:56:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Interrogazione API Google Books - dati mancanti on Mon, 23 Nov 2020 09:10:56 GMT]]></title><description><![CDATA[<p dir="auto">Ciao Sermatica, tutto offline. si collega solo per ricavare le info del libro tramite API, ma il resto é tutto in local.</p>
]]></description><link>https://dev.connect.gt/post/1280096</link><guid isPermaLink="true">https://dev.connect.gt/post/1280096</guid><dc:creator><![CDATA[ndakota]]></dc:creator><pubDate>Mon, 23 Nov 2020 09:10:56 GMT</pubDate></item><item><title><![CDATA[Reply to Interrogazione API Google Books - dati mancanti on Mon, 23 Nov 2020 05:33:00 GMT]]></title><description><![CDATA[<p dir="auto">Ciao<br />
il progetto è offline o online?</p>
]]></description><link>https://dev.connect.gt/post/1280076</link><guid isPermaLink="true">https://dev.connect.gt/post/1280076</guid><dc:creator><![CDATA[sermatica]]></dc:creator><pubDate>Mon, 23 Nov 2020 05:33:00 GMT</pubDate></item></channel></rss>