Bring your data to life with OpenAPIHub today! In this post, learn to add your data to Airtable and expose it as an API on OpenAPIHub. OpenAPIHub provides a quick and easy way to reach new users and monetise your API endpoints. Get started now with OpenAPIHub for Free!
Table of Contents
In order to follow this tutorial, you should already…
With those two things sorted, you are ready to proceed!
The first step of the process is to prepare your data, creating an Airtable Base and an API Key.
Create Airtable Base
Creating an Airtable base is easy, just take the following steps:
- Go to airtable.com
- Click on Add a base
- Give your base a name and populate it with data
For this guide, we use the Hong Kong population dataset available at data.gov.hk.
Create Read-only Key
Refer to this guide to create a read-only key. You may also choose to use your personal Airtable API key, however this is less secure.
Data API Creation
Next up, we start creating our API using the OpenAPIHub platform.
Generate OpenAPI Specification
In order to add an API to OpenAPIHub, you must first have a Swagger/OpenAPI3.0 document that describes the API.
The purpose of the Airtable to Swagger API is to automate this step, and make it easier for non-technical users to complete this tutorial.
- Navigate to the documentation page of your Airtable base by going to airtable.com/api and selecting your base.
- Download the HTML of the website by clicking on Save as…
- Copy the contents of the HTML file you just downloaded
- Navigate to the Airtable to Swagger API
- Subscribe to the API and navigate to the endpoint /from-html-file-to-swagger
- In the request body, paste the contents of the HTML file
- Click on Try It Out
- Copy the response to a new file called swagger.json. This is your Swagger/OpenAPI3.0 specification.
Create API Portal
Creating an API on OpenAPIHub is easy! Just follow these simple steps:
- Create an API Portal by clicking on this link.
- In the Provider Portal, use the API Wizard to create your API.
- Make sure to add the specification we generated in the previous segment.
When the API Portal is created we are one step away from making our data available to users.
Add API Transformation
In order to properly access the Airtable API, we need to provide our API Key. However in order to avoid having to expose it to our users, we will include it as an API Transformation on OpenAPIHub. This injects our API Key with every request and hides it from our users.
To add an API Transformation:
- Go to the OpenAPIHub Provider Portal
- Select your API
- Click on Edit
- Under the Transformations tab, click on Create
- Select Query, Add and Static
- For Key, type “api_key”
- For Value, paste your Airtable API Key
- Click on Save
For more information regarding API Transformation, see the Parameter Transformation page on the OpenAPIHub learning site.
Verify that your API is working by going to the Endpoints tab of your API on OpenAPIHub, finding an endpoint and clicking on Try It Out. If data from your Airtable base is being displayed, the onboarding process was successful!
Today we have shown one of many ways you can use OpenAPIHub to add value to your business or enhance your personal portfolio. Once your API is up and running on OpenAPIHub, you can monetise it for additional revenue streams, or explore additional customisation options.
Ready to Start Your API Journey?
Join OpenAPIHub and connect to the fast growing API Hub Community to grow your API Business today!