How to make your first API call on RapidAPI in 5 minutes
UpdatedShort answer
Sign up on RapidAPI, open the API's page, subscribe to its Basic plan (it has a free monthly allowance), then go to the Endpoints tab, fill in a value and click Test Endpoint. The answer shows in your browser. Open Code Snippets, pick your language and copy the code. It already includes your X-RapidAPI-Key and the API's X-RapidAPI-Host headers.
1. Sign up (1 minute)
- Go to rapidapi.com and click Sign Up at the top right. Signing in with Google or GitHub is fastest.
- RapidAPI makes a default app for you, which holds your key. You don't need to set anything up.
2. Subscribe to the free plan (1 minute)
- Open the API's page. For this example, use Dnsward Domain Security Check (our APIs page links to it).
- Open the Pricing tab and choose the Basic plan. It has a small monthly allowance at no charge, with a hard limit, so you can't run up a bill by accident.
- Confirm the subscription. Many APIs on RapidAPI work the same way: if an API has plans, you pick one before you can call it.
3. Test an endpoint in the browser (2 minutes)
- Go back to the Endpoints tab and choose an endpoint. For Dnsward, pick GET /check.
- Type a value in the parameters: for
domain, enter a domain you own, such asexample.com. - Click Test Endpoint. The response appears on the right. For Dnsward, it's a grade from A to F with every finding and its fix.
4. Copy the code (1 minute)
- Open Code Snippets and choose your language (curl, JavaScript fetch, Python requests and many more).
- Copy the snippet into your project. It already has the two headers every call needs: X-RapidAPI-Key (your key) and X-RapidAPI-Host (the API's address on RapidAPI).
- A curl call looks like this (your real host and key are in the snippet):
curl --url 'https://<api-host>.p.rapidapi.com/check?domain=example.com' \
--header 'X-RapidAPI-Key: <your key>' \
--header 'X-RapidAPI-Host: <api-host>.p.rapidapi.com'Keep your key safe and watch your usage
- Your key is like a password. Keep it on your server or in an environment variable; don't put it in a web page, a public repo or an app people can download.
- If a key leaks, make a new one for your app in the Developer Dashboard and stop using the old one.
- See your calls and what's left of your monthly allowance in the Developer Dashboard. Each response's headers also show how many calls you have left.
Tips
- Use the playground to try odd inputs (an empty value, a typo) before you write error handling.
- Every Dnsward response carries an X-Request-Id header. Quote it if you write to us about a call.
- Ready for more calls? Change plans on the API's Pricing tab; your key and code stay the same.
From our shop
- Dnsward Domain Security Check: Grades a domain's SPF, DMARC, DKIM, DNSSEC and HTTPS headers A to F, with plain-English fixes
All our APIs: Puzzle Generator, Name Parser, Cron Explainer, US Baby Name Trends and more →
Questions
Do I need a credit card for the Basic plan?
That's up to RapidAPI and the API's plan. Our Basic plans are free, with a hard monthly limit and no overage. RapidAPI shows what it needs when you subscribe.
Where do I find my X-RapidAPI-Key?
In any endpoint's code snippet on RapidAPI, or under your app in the Developer Dashboard.
Why do I get a 403 or "not subscribed" error?
You haven't subscribed to a plan for that API yet, or the key belongs to a different app. Subscribe on the Pricing tab and use the key shown in that API's snippet.