Stuck on an API call

Hi there, I’ve worked with APIs in Bubble before and haven’t had an issue, but I’m having a problem getting an output from the PubMed API to show, well, anything really.

So I’ve started by initiating the API here (It’s an XML API):

This gets me the expected results:

So then all we need to do is print something on the screen to show that it’s working (Let’s just put the “count” there):

Result on frontend? Nothing.

Why not? I can see I’m getting a result when I initialise. I’m obviously doing something wrong, but I can’t work out what it is - I’ve tried testing some other public APIs and I can get data from them. Is there something special about this one?

Does the parent group have data in it?

Yep, think so:

Yep, think so:

Have you checked?.. (in the debugger)

There is no data in there, but I don’t understand why not, I’ve set the content type and data source.

I fixed it:

By unchecking “Optional” on the “term” parameter.
It wasn’t empty in my API call, but it isn’t optional according to the API docs.

Well I’m glad it’s sorted, but that wasted an afternoon! :roll_eyes:

1 Like