Search results for an API in php / json

2

I'm using the following API: link This is a database of books / documents and I need to access it there to fetch some records. I already have the registry and a key to use. It's just that I've never done anything like it, and I do not see how it works. I have to make a connection to the webservice, right? From there how to get this data?

They have an example here: link . For now it was something like this I want to do.

    
asked by anonymous 20.11.2014 / 15:27

1 answer

1

As far as I can see here, this request sends an ajax to link where you can put the parameters , for example, my test query was "hi":

  

a>

This was the link that was generated by it, what you need to do is perform a post or a get through a cURL or ajax see here:

In this case what you need to do is retrieve what is returned, which is an xml, through a string. Then you can use PHP methods like simplexml for read the xml returned and work with it.

If it's json it's even easier, just use json.decode($retorno,TRUE); to transform the return you can get through cURL >:

In this case you do not need to use javascript, this makes things a bit simpler.

    
21.11.2014 / 22:40