DEV Community

Cover image for Introducing RapidQL: Fetch, combine, and aggregate data from multiple APIs and databases in a single call
Alex Walling
Alex Walling

Posted on

Introducing RapidQL: Fetch, combine, and aggregate data from multiple APIs and databases in a single call

Have you ever wanted to grab an address, lookup the 10 nearest restaurants, and provide Uber price and ETAs — all in a single API call? What about fetching a list of users from a database and simultaneously doing email validation and phone number validation?

Well now you can, with RapidQL, our recently launched open source project.

And those are just two examples of the many combinations made possible when you can query, combine, and aggregate data from multiple APIs and databases in a single API call.

// Get a list of users and fetch the weather based on the city saved on their account
rql.log(`{
    - MySQL.RQLDemo.rqlDemo.find(){
        username,
        city,
        - Http.get(
            url:"https://community-open-weather-map.p.rapidapi.com/weather",
            params: {
                "units": "imperial",
                "q" : city
            }
        ){
            - weather {
                main
            },
            - main {
                temp
            }
        }
    }

We Launched on ProductHunt! 🎉

Check us out on ProductHunt to learn more about why we launched it and how it will help simplify fetching data from multiple data sources!

Try it out

The inspiration for RapidQL is to make it easy for developers to simultaneously make requests to APIs as well as databases, defining only the fields you need returned from each and avoiding expensive additional round trips.

Queries made to databases like MySQL, PostgreSQL, and MongoDB can take advantage of aggregations like count and average. These results can be fed into the next query in the RapidQL statement.

And of course, you can also connect to more than 10,000 public APIs on RapidAPI’s Marketplace.

RapidQL itself is a JSON-like query language implemented in JavaScript. Just $ npm install rapidql to download it, then check out the documentation to see how to run your first query.

Show us what you’ve got

To celebrate the launch of RapidQL, we’ll be highlighting and sharing any projects that you build over the next few weeks! Here’s how you can join in:

Take a look at the RapidQL docs
Create an example RapidQL call on CodePen
Tweet us your best ideas, mentioning @Rapid_API and #RapidQL. Include a link to the pen and a screenshot, if possible.
We’ll retweet all of the most useful, the funniest, and the most complex queries you build!

Contributions welcome

RapidQL is open source, and we welcome all contributions to the codebase. You’re invited to support the core system (see open issues in GitHub), as well as develop integrations with more data sources and database systems (see planned integration in project board in GitHub).

Top comments (0)