I\'m having trouble using the Google Books API
I am inexperienced in working with JSON.
My form:
Take a look at the Google Books API client library for PHP https://developers.google.com/books/docs/v1/libraries (They have some examples.) What you're trying to do is not going to work for at least two reasons:
header("Location: $page");
redirects; it doesn't grab the page contents.Edit: The authenticating part is not true if you don't need to access or create your own "bookshelves." So you could try:
$data = file_get_contents($page);
$data = json_decode($data, true);
$item = $data->items;
Well you ale retrieving the JSON info so that's the hard part.
In order to print the data via php try something like the following;
$page = file_get_contents($page);
$data = json_decode($page, true);
echo "Title = " . $data['items'][0]['volumeInfo']['title'];
echo "Authors = " . @implode(",", $data['items'][0]['volumeInfo']['authors']);
echo "Pagecount = " . $data['items'][0]['volumeInfo']['pageCount'];