NewsAPI - Filter for only certain Keywords

I am trying to get a list of articles about a certain subject (example: ‘taxes’ or ‘Montana’) using the NewsAPI plugin. Currently, my app get all returns articles, and the API doesn’t have the option to only get articles about a certain subject / keyword. Is there a way to get all returns from the API and then only display articles that contain certain keywords?

What about this API connecting with Bubble?

http://www.faroo.com/hp/api/api.html

Try adding filter at the end of your datasource then add a constraint to only include articles that ‘contains’ the certain word.

One risk with this is that it may be prohibitively slow. My understanding is if you add a constraint after the main search is that Bubble will pull everything, loading everything to the UI, and then filter it at that point to only display what you want. As such, it may be a lot of data to load that isn’t used.

Worth testing though. Just wanted to point out the risk. I haven’t used it in this way so I could be wrong too.

Yeah correct it is slow. I would be keen to hear if there is a quicker way for this use case also.

Another solution would be to load all of the news articles into your database (every day or every hour, or something like that). Then, search it and within the core search itself match with contains to the title or description. This way, the search is done in the database and only the relevant articles are passed from DB to the client.

1 Like