This is not a Hugo question, but rather how you have to use a particular web API. I suggest that you build a working query outside of your Hugo environment (e.g. with curl or wget) and then put it (the working query) into your code.
Just a hint: There’s still an error in your query since blancs are not permitted in URLs
yes i have seen the problem was the blanc but this is not me that have done this API.
And i thinks the ones who have done it: they had code it with the foots
As I said before: make sure that the call works on the command line. If it does not, talk to the people at archives ouvertes. If it does, something in your Hugo setup is not correct.
The call itself works in Hugo, too. It is the stuff afterwards that does not. And you do not even say so. If you get an error message (and I’m sure that you do, because I did) post it. Nobody here is a clairvoyant so spare us and yourself the time to hunt around uselessly.
And if you do get an error message, try to understand it and dig deeper. In your case, you were trying to use first with an (JavaScript) object, and Hugo complained bitterly that first got a non-supportet input. That’s the moment to have a look at what you feed it, namely the JSON. It begins like this:
{"response":{"numFound":52,"start":0,"docs":[...
So response is an object that has three properties, namely numFound, start and docs. There simply is no order in the properties of an object, so first can’t work.
It can work with arrays (aka map in Hugo parlance). So you have to get at that part of the repsonse before using first.
again thanks chillek.
I had found the solution by my self before our last answer.
I have a last question:
in my API’s response there is some array (like: authFullName_s).
How can acces to the differents rows?
because if do: {{ .authFullName_s }} this returne the array with the [ ].
I know how to do it in Javascript and PHP but not with hugo.
I imagine that i have to do loop on it but i don’t know how?
I code since only 1year.
your realy patient ^^