There are countless public APIs available on the internet. These APIs are of every category, from finance to travel to sports or entertainment. Using them instead of writing code themselves can help developers save time and effort.
You can also write an API and make it publicly accessible.
Have you ever considered making money from your APIs by selling them as a viable product? You can do it either by setting up your own infrastructure to manage and monetize your API or by using RapidAPI Studio. The latter sounds better.
In this piece, we will learn about RapidAPI Studio and look at its API management feature called Hub Listing to manage and monetize our APIs. So without any further ado, let’s jump in!
RapidAPI Studio houses different RapidAPI products into a single platform to provide an integrated user experience to build, consume, and govern APIs. It has the power of RapidAPI Provider to help you publish your APIs on RapidAPI Hub. It utilizes the strengths of Paw to create different branches, sessions, and environments to quickly debug your APIs.
RapidAPI Studio offers three features to its users, i.e., Requests, Tests, and Hub Listing. Previously, we have discussed the Requests feature and looked in detail regarding how to use it. If you are interested, you can find that piece here.
The Hub Listing inside RapidAPI Studio is not limited to publishing APIs on RapidAPI Hub. Instead, you can use it for other things like securing your API, validating query parameters, setting up a gateway, adding RapidAPI Auth to your API, monitoring your API performance, setting up alerts, and so much more.
If you decide to make money from your API, you can use RapidAPI Studio to publish them on RapidAPI Hub instead of setting up a whole infrastructure. This will make your API accessible to millions of developers around the globe.
Before we go any further, let’s briefly examine the features of Hub Listing that I mentioned earlier. You may recognize them if you have previously used RapidAPI Provider.
Adding authentication to APIs help to track their usage and also secure them. If you are missing out on it, you can use the Hub Listing feature of RapidAPI Studio to do it for you. All you need is an account. You can create it for free.
If you already have an account, head to RapidAPI Studio and add a project. Inside this project, you can add your API base URL, create API endpoints, and enable RapidAPI Authentication.
This way, only the users who have a valid API key from RapidAPI will be able to use your API.
The Hub Listing present inside RapidAPI Studio has a tab called Community, where you can find all the users who are subscribed to your API. There are two categories there; the first is Paid Users, and the second is Free Users. All your users are divided between these two categories.
You can send a private message to any of your API users from the Community tab. If they need a private plan, you can create one for them (more on this later) and invite them to it.
The Open Web Application Security Project (OWASP) lists 10 API security vulnerabilities. One of them is the absence of request schema validation in APIs.
Inside the Hub Listing feature of RapidAPI Studio, you can also set up request schema validation if you haven’t implemented it in your API. The request schema validation provides three options.
- Passthrough Everything (default)
- Strip and Passthrough
The first is the default behavior, where if the request contains a header or query parameter not defined in the API specification, the request will not be blocked.
The second will pass the request but strip the headers or query parameters not defined in the API specification.
The last one will block the request if it contains anything not defined in the API specification.
If your API is public, anyone can send a huge payload when calling it. This can slow down the server.
Inside the Hub Listing, you can limit the request size. You can also configure the timeout between proxy and target endpoint.
You can set custom alerts for your API using the Hub Listing of RapidAPI Studio. These alerts will notify you immediately once a particular alert metric crosses a threshold.
You can create multiple versions of an API inside the Hub Listing of RapidAPI Studio. For every new version, you can also define a different base URL, endpoints, transformations, and more. You can also build on top of an existing version.
API versioning is vital because it provides backward compatibility for your API, and your users do not have to move to the newer version immediately. They can do it at their own pace.
Inside RapidAPI Studio, you can find analytics for each of your APIs. It is present as a separate tab inside the Hub Listing feature of RapidAPI Studio. It centrally views, manages, analyzes, and monitors API usage across teams and organizations.
These analytics further consists of five sections.
- Traffic Analytics: Shows the total API calls, average error rate, and average latency. You can also look at median, max, and min error rates and latencies.
- User Analytics: Here, you can find active and total users of your API in the form of a graph.
- Revenue Analytics: You can see how much money your API made over the past 3, 6, or 12 months.
- Logs: Every API request your user makes gets logged here. You can expand each log to look at log details like the request header, request body, response header, etc. This helps you track down the issue with your API if it fails for some reason.
- Alerts: You can set up custom alerts for your API to alert you if something happens. For instance, you can create an alert that immediately lets you know when the total response size exceeds 500 KBs.
You can monetize all the APIs you add on RapidAPI Hub from the RapidAPI Studio. It provides you with two options, i.e., public and private plans.
As you can see, the public plans further contain basic, pro, ultra, and mega plans. You can customize each of them according to your liking. You can set up rate limiting, limit access to an endpoint, and more.
If the user does not find a plan according to their needs, you can create one for them using the private plans. The private plans let you utilize all the accessibility of the public plans. The only difference is you need to invite people to it.
Rate Limiting is the process through which you limit the number of requests coming to your API in a certain amount of time. It allows API providers to keep their APIs running for all users by controlling the number of requests. All in all, rate-limiting is a critical defensive measure for APIs.
To implement one for your API, you need a sound technical knowledge of servers and middlewares and select one of the many available approaches for rate limits. Instead, you can use the Hub Listing inside RapidAPI Studio to implement these limits in a jiffy.
For example, you can set it to allow only 20 requests in one minute. Furthermore, many APIs offer multiple pricing plans to their users, and naturally, the rate limits for expensive plans should be better. That’s why you can set different rate limits for different plans in the RapidAPI Studio API dashboard to provide a better developer experience.
Let’s look at how we can use the Hub Listing feature of RapidAPI Studio to manage our API.
Click the Add API Project button on the RapidAPI Studio dashboard. Now give the API a name, add some description, and select the API category. I will keep the team Personal and the default “Do not import” option under “Import data from”.
Once you are done, click on Add API Project.
Now click on Hub Listing from the left sidebar. It will change the page, and now you will see different tabs like General, Endpoints, Gateway, Community, Monetize, and Analytics. By default, the General tab will be opened.
You can add details in the general tab like creating a readme for your API, updating its logo, etc. Scroll down to the bottom. You will see an option to add the base URL of the API. Since I am adding a Zoo Animal API, I will add its base URL here.
Let’s create an endpoint. For this, click on the Endpoints tab at the top. It will change the page where now you can see we have options to create REST and GraphQL endpoints. Since the API I am using is a REST API, I will click on Create REST Endpoint.
Now we can see more options to name our endpoint, give it some description, select its HTTP method, write the endpoint path, and provide a bunch of other information about it.
After you are done, click the Save button.
The next step is to share the API with other people privately. For this, go to the Community tab and select Invite Users. It will show a field where you can search for a user, organization, and team. Let’s go with the user. I will type the name of the user and click on Send Invite.
Make sure the person you invite has signed up on RapidAPI; otherwise, you will not be able to find them.
And that’s pretty much to it.
You can also make the API public so anyone can use it from RapidAPI Hub. To do that, go back to the General tab, scroll down, and toggle the visibility icon under the Visibility heading.
Now go ahead and click on View in Hub from the top right corner. It will open an API playground inside RapidAPI Hub with your API.
That’s all, folks! If you liked this feature and enjoyed reading about it, I recommend you look at the following pieces:
- How to use the API client inside RapidAPI Studio?
- How To Use RapidAPI Client for VS Code and RapidAPI Studio to Test APIs?
We have also launched an API client for VS Code that can help you test and debug your APIs without switching the context. If you want to read more about it, take a look at the following pieces: