Search code examples
oauth-2.0google-apipostmangoogle-oauthrapidapi

how to generate X-RapidAPI-Key without accessing https://rapidapi.com via Browser


This question was originaly posted in rapidapi forum

Basically, I want to use one of the free APIs provided by RapidApi (skyscanner api)..

It is quite straighfoward if you log in RapidApi. You are rerdirected to OAUTH2 server (gmail in my case) and then X-RapidAPI-Key is filled in automatically. I want to call it from my application but how can I retrieve X-RapidAPI-Key?

For instance, I guess I can call via PostMan some url from RapidApi.com which will redirect me to gmail and then I log in and it will provide me such X-RapidAPI-Key. I have looked for such info in their site but I didn't find it. Maybe it is so obvious but I don't know how to figure out it.

I assume it is exactly what it is happening behind the scene when rapidApi.com ask me to log in with my gmail/github/facebook account. Kindly, don't misunderstand my question as asking how to develop or consume an OAUTH2 server. It is quite specific about getting X-RapidAPI-Key from rapidapi.com without accessing it throw a browser.


Solution

  • It doesn't look supported in neither RapidAPI nor Skyscanner. You should contact support/community and respectively ask both.

    Depending on where does this Oauth flow happens, you can always try some cURL to perform logged-in actions to a specific webapp (e.g. rapidapi) if compatible. Then, output necessary elements to use as values.

    Might not be super secure, but if it's for personal use, it shouldn't be a problem.