Hi OR community!
When I add a column json based on this URL
{"ISBN:1860390323": {"publishers": [{"name": "Orchard Books"}], "identifiers": {"isbn_13": ["9781860390326"], "openlibrary": ["OL12052499M"], "isbn_10": ["1860390323"], "oclc": ["35208816"], "goodreads": ["1731978"]}, "weight": "2.7 ounces", "title": "The Amazing Mr. Pleebus (Orchard Readalones)", "url": "https://openlibrary.org/books/OL12052499M/The_Amazing_Mr._Pleebus_(Orchard_Readalones)", "number_of_pages": 64, "cover": {"small": "https://covers.openlibrary.org/b/id/3013949-S.jpg", "large": "https://covers.openlibrary.org/b/id/3013949-L.jpg", "medium": "https://covers.openlibrary.org/b/id/3013949-M.jpg"}, "publish_date": "June 20, 1996", "key": "/books/OL12052499M", "authors": [{"url": "https://openlibrary.org/authors/OL3306530A/Nick_Abadzis", "name": "Nick Abadzis"}]}}
Now it should be possible to extract values by a key, e.g. the number of pages
value.parseJson().get("number_of_pages")
It only works when I remove the first element from the JSON (the "ISBN:and specific number")
{"publishers": [{"name": "Orchard Books"}], "identifiers": {"isbn_13": ["9781860390326"], "openlibrary": ["OL12052499M"], "isbn_10": ["1860390323"], "oclc": ["35208816"], "goodreads": ["1731978"]}, "weight": "2.7 ounces", "title": "The Amazing Mr. Pleebus (Orchard Readalones)", "url": "https://openlibrary.org/books/OL12052499M/The_Amazing_Mr._Pleebus_(Orchard_Readalones)", "number_of_pages": 64, "cover": {"small": "https://covers.openlibrary.org/b/id/3013949-S.jpg", "large": "https://covers.openlibrary.org/b/id/3013949-L.jpg", "medium": "https://covers.openlibrary.org/b/id/3013949-M.jpg"}, "publish_date": "June 20, 1996", "key": "/books/OL12052499M", "authors": [{"url": "https://openlibrary.org/authors/OL3306530A/Nick_Abadzis", "name": "Nick Abadzis"}]} This is for demonstration purposes to show this OR feature. I could remove the first element or extract the number of pages with a regex in a real project.
But how can I get the value of an element by its key in the complete API result?
If it's not possible with
openlibrary.org could someone recommend a free ISBN API that is easy to parse?
Thanks,
Wolf