Back to all courses
Building and selling APIs is a great way to create a new source of passive income. Thus, in this video, you will see how to monetize your API!
A software engineer that talks about all topics in tech. I create programming tutorials; mostly about Web Development and JavaScript. Occasionally, I cover other topics as well! I also create developer vlogs where I talk about other topics than coding.
This guide will teach you how to make money by posting your custom APIs on RapidAPI, the world's largest API Marketplace. RapidAPI is used by developers to discover and connect to thousands of APIs.
I have created a preview API and hosted it on Heroku to demonstrate what you will do in this guide. It is a simple API that returns the world's top 10 most populated countries. The goal is to make this API available on RapidAPI Hub to monetize it.
To monetize our newly built API, we can use RapidAPI, which provides different plans and pricing options for the users to use that API.
On RapidAPI Hub, you can also see a ton of APIs for anything you want to do in your project or whatever you want to implement. So if you go to its website, you'll be able to see wide varieties of APIs that you can use
For example, if you search for SMS service API, you will find a plethora of APIs for that service. That is what RapidAPI is all about.
You can easily obtain the APIs you require, but as a developer, you can also build your own API, publish it on the RapidAPI Hub, and make money from it. So, in this guide, that is what we will be doing.
As I previously demonstrated, the world's top 10 most populous countries are returned via our preview API. The first step is verifying this using a platform called Paw.
Once you open the Paw application, you need to paste the link (https://top-countries-api.herokuapp.com/top-populated-countries) of our API on the search bar and make a GET request. You will see a 200 status code. In the Response section, you will see China, India, the United States, and other countries with their population values.
This demonstrates that our API is functional and can now utilize as needed. You can leverage their APIs and become inventive if you want to construct an API to obtain the most recent news, learn about the current weather, or even play a game.
Once your API is built and hosted on Heroku, you can add to RapidAPI to continue the process. You can go to RapidAPI Hub and Sign up for a free account as well.
From here, the next thing to do is go to the top right corner and click on My APIs. Once you click on that, it should take you to this dashboard, where you see a list of APIs you've created before and the analytics for all.
Since you might not have created any API using this platform, let's say it is your first API; you just need to come to the top left corner and click on Add New API.
Once you click on that, you can create a new API on RapidAPI Hub. Let's start making a new API.
The first step is to write the API name. Let's just say it is Countries Population. In the Short Description section, you can write Get the population of the top 10 countries. In the Category section, you can select News, Media. Let's specify our API using UI and click on Add API.
Once you click on Add API, it will ask for other information such as write, short description, long description, upload image, website, and terms of use. We can skip this information, except for the website. You can paste the copied URL earlier, i.e., https://top-countries-api.herokuapp.com/, and let's just click on save.
The second step is to add the Base URL. For this, we need to click on configure. We will add the base URL to the API, and then we will click on save. Our base URL is this: https://top-countries-api.herokuapp.com/
In the next step, let's create an Endpoint. We need to name it first. Let's name it "Get Top 10 Countries". In the Description, you can write Get the population of the top 10 countries. Lastly, let’s add the API endpoint, i.e.,/top-populated-countries.
Once you have completed the information, let's click Save to Test Endpoint. Here we can also click on Test Endpoint. You will see that it is verified 200. Let's click on save.
So now that we have that particular Endpoint saved, the next thing that we want to do now is to add our Plans & Pricing.
This is where our APIs generate revenue. You will notice that we have various pricing plans in this section. The BASIC plan is free and gives users limited access to API. We can also change the free BASIC plan. Instead of unlimited, we can choose monthly in Quota Type. We can also set a monthly Quota limit of 2500 times. We can set Limit Type to Hard Limit; once that's done, we can simply click save.
We can also charge users using the PRO plan. As with the BASIC plan, we will fill all the categories in the PRO plan, but for Overages, we can charge $0.2 USD per extra. We can save by clicking the Save button. As you can see, we have two plans prepared. And once you've completed all of this, you're ready to make your API public.
You are now ready to make our API available to the public. To complete the process, simply toggle the Private button to Public and click Make API Public.
So, now that our API is public, we can simply click on Viewing Hub. As you can see, we only have one endpoint that says Get Top 10 Countries. We can also test the Endpoint to ensure that everything is working correctly.
You can see the population of India, China, and so on. This indicates that the API in question is operational. We also have a pricing plan that we added to it that allows you to make money with your API.
That's all for now, folks! We built and monetized our API successfully. So go ahead and experiment with it to create exciting APIs.