0

I am using Contextual Web search REST API called Custom search.

https://rapidapi.com/contextualwebsearch/api/custom-search

Here I can search any news topic i like from the newssources i want. So far so good! But i now try to make a "home page" with breaking news, to get the latest articles in the world with politics, tech, finance etc.

apiClient.DefaultRequestHeaders.Add("x-rapidapi-host", HostHeader);
apiClient.DefaultRequestHeaders.Add("x-rapidapi-key", KeyHeader);

string searchterm = "Obama";
var responseMessage = await apiClient.GetAsync("https://custom-search.p.rapidapi.com/api/search/CustomWebSearchAPIV2?q=" + searchterm + "&searchEngineId=43212194233309&pageNumber=1");

var response = responseMessage.Content;
var json = await response.ReadAsStringAsync();

Right now my code looks like this, and in this case the search term is "Obama". Articles loads in very nicely. But how would i adjust the search term to get breaking news? As this query is only limited to artciles regarding "Obama".

An idea i had was to perhaps make the searchterm something like: "politics-finance-tech-health". But unsure if this will give me the needed results.

Maybe someone with more experience with this rest API can share their knowledge!

DiddanDo
  • 401
  • 1
  • 5
  • 15

1 Answers1

0

i suggest you search for something like "world news", or you create a tab view with each section being a popular category of news... eg, health, art, science, politics and you display the top news in those sections