Pulling data from a website

hello I am working on a book tracker app and I want my users to be able to look up books on the app and from there add to their favorites/ organize/ rate and review them. I have a key from ISBNdb for the list of books database but having some difficulty figuring out how to connect it to my app. Can anybody provide some guidance, thank you!

What “key” are you mentioning here? Is it an API key? Does the website provide a way to get data through an API?

1 Like

Hi @ThinhDinh yes its an API key I am a bit confused how to connect it I guess to the app

What is the URL?

this is the website https://isbndb.com and they have a log of a bunch of books data so I wanted to use them for the search option

the URL for the API cal

I am not too sure what you mean like they API key?

The URL for the JSON request… you said that you have a key… now you need the URL to attach that key to :wink:

  1. $url = ‘https://api2.isbndb.com/book/9780134093413’;

  2. $restKey = ‘YOUR_REST_KEY’;

  1. “Content-Type: application/json”,

  2. "Authorization: " . $restKey

  3. );

  1. curl_setopt($rest,CURLOPT_URL,$url);

  2. curl_setopt($rest,CURLOPT_HTTPHEADER,$headers);

  3. curl_setopt($rest,CURLOPT_RETURNTRANSFER, true);

  • $response = curl_exec($rest);

  • echo $response;

  1. print_r($response);

  2. curl_close($rest);