Using APIs in Rapid API

Hi,

I want to use APIs which are provided by Rapidapi.com. I have seen your example of openweather API and that is working fine for me. However in RapidAPI I dont get a single URL which can be used like open weather.

Below is Open weather URL:
https://api.openweathermap.org/data/2.5/weather?q={{city}}&appid={{key}}

Can I get something like above from rapid API too, else what is the way to use it?

1 Like

Hey @Pranav,

Can you please share the CURL request of the API from Rapid API?

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, “GET”);
curl_easy_setopt(hnd, CURLOPT_URL, “https://veriphone.p.rapidapi.com/verify?phone=%2B4915123577723”);

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, “x-rapidapi-host: veriphone.p.rapidapi.com”);
headers = curl_slist_append(headers, “x-rapidapi-key: b7130cd11emsh69c66e351fdc6a0p151e09jsne8a300fc200c”);
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);

@Pratik above is from Veriphone API. In case you want to validate, you may check the API on their site.

1 Like

I’ve checked the veriphone API, API request you’ve provided doesn’t seem right though.

Can you please make sure you’ve selected Shell cURL from the dropdown menu, as shown in the screenshot below:

Thanks @Pratik , I was able to import the API into YM. Thanks for your help.

1 Like