<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Alex Walling</title>
    <description>The latest articles on DEV Community by Alex Walling (@alexwalling).</description>
    <link>https://dev.to/alexwalling</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F168731%2F98b00aa1-019d-47bf-9eaf-2734fe5ef89c.jpg</url>
      <title>DEV Community: Alex Walling</title>
      <link>https://dev.to/alexwalling</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alexwalling"/>
    <language>en</language>
    <item>
      <title>Introducing RapidQL: Fetch, combine, and aggregate data from multiple APIs and databases in a single call</title>
      <dc:creator>Alex Walling</dc:creator>
      <pubDate>Tue, 04 Feb 2020 16:55:59 +0000</pubDate>
      <link>https://dev.to/alexwalling/introducing-rapidql-fetch-combine-and-aggregate-data-from-multiple-apis-and-databases-in-a-single-call-5h6i</link>
      <guid>https://dev.to/alexwalling/introducing-rapidql-fetch-combine-and-aggregate-data-from-multiple-apis-and-databases-in-a-single-call-5h6i</guid>
      <description>&lt;p&gt;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?&lt;/p&gt;

&lt;p&gt;Well now you can, with &lt;a href="https://rapidql.com"&gt;RapidQL&lt;/a&gt;, our recently launched open source project.&lt;/p&gt;

&lt;p&gt;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.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// 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
            }
        }
    }

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  We Launched on ProductHunt! 🎉
&lt;/h2&gt;

&lt;p&gt;Check us out on &lt;a href="https://www.producthunt.com/posts/rapidql"&gt;ProductHunt&lt;/a&gt; to learn more about why we launched it and how it will help simplify fetching data from multiple data sources!&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it out
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;And of course, you can also connect to more than 10,000 public APIs on &lt;a href="https://rapidapi.com/"&gt;RapidAPI’s Marketplace&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VyPQfhs8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://rapidapi.com/blog/wp-content/uploads/2020/02/63e09e3c-ffd6-40d4-84bf-f8666e6cb71f.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VyPQfhs8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://rapidapi.com/blog/wp-content/uploads/2020/02/63e09e3c-ffd6-40d4-84bf-f8666e6cb71f.jpeg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;RapidQL itself is a JSON-like query language implemented in JavaScript. Just &lt;code&gt;$ npm install rapidql&lt;/code&gt; to download it, then check out the &lt;a href="http://docs.rapidql.com/"&gt;documentation&lt;/a&gt; to see how to run your first query.&lt;/p&gt;

&lt;h2&gt;
  
  
  Show us what you’ve got
&lt;/h2&gt;

&lt;p&gt;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:&lt;/p&gt;

&lt;p&gt;Take a look at the &lt;a href="http://docs.rapidql.com/"&gt;RapidQL docs&lt;/a&gt;&lt;br&gt;
Create an example RapidQL call on &lt;a href="https://codepen.io/"&gt;CodePen&lt;/a&gt;&lt;br&gt;
Tweet us your best ideas, mentioning &lt;a href="https://twitter.com/Rapid_API"&gt;@Rapid_API&lt;/a&gt; and #RapidQL. Include a link to the pen and a screenshot, if possible.&lt;br&gt;
We’ll retweet all of the most useful, the funniest, and the most complex queries you build!&lt;/p&gt;

&lt;h2&gt;
  
  
  Contributions welcome
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/RapidAPI/rapidql"&gt;RapidQL is open source&lt;/a&gt;, and we welcome all contributions to the codebase. You’re invited to support the core system (see &lt;a href="https://github.com/RapidAPI/rapidql/issues"&gt;open issues&lt;/a&gt; in GitHub), as well as develop integrations with more data sources and database systems (see planned integration in project board in GitHub).&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>node</category>
      <category>api</category>
    </item>
    <item>
      <title>Introducing RapidAPI's Student Program: RapidAPI School [Who is Eligible, How to Apply]</title>
      <dc:creator>Alex Walling</dc:creator>
      <pubDate>Thu, 24 Oct 2019 21:42:37 +0000</pubDate>
      <link>https://dev.to/alexwalling/introducing-rapidapi-s-student-program-rapidapi-school-who-is-eligible-how-to-apply-3obg</link>
      <guid>https://dev.to/alexwalling/introducing-rapidapi-s-student-program-rapidapi-school-who-is-eligible-how-to-apply-3obg</guid>
      <description>&lt;h2&gt;
  
  
  Introducing RapidAPI School
&lt;/h2&gt;

&lt;p&gt;We know just how powerful APIs are, and we want to ensure students are getting ample experience with APIs as they learn to code — that’s why we created RapidAPI School.&lt;/p&gt;

&lt;p&gt;RapidAPI School includes a selection of free or discounted pricing plans just for students. It includes some of the most popular APIs available on the RapidAPI Marketplace like &lt;a href="https://rapidapi.com/therundown/api/therundown"&gt;TheRundown&lt;/a&gt;, &lt;a href="https://rapidapi.com/zestfuldata/api/recipe-and-ingredient-analysis"&gt;Zestful&lt;/a&gt;, and &lt;a href="https://rapidapi.com/api-sports/api/api-football"&gt;API-FOOTBALL&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can view the current collection of APIs that have customized pricing plans for students &lt;a href="https://rapidapi.com/collection/rapidapi-school"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who is Eligible for RapidAPI School?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Student Eligibility
&lt;/h3&gt;

&lt;p&gt;Students who are currently enrolled at an accredited college or university can &lt;a href="https://rapidapi.typeform.com/to/oxolPp"&gt;join the waitlist now&lt;/a&gt;. Be sure to enter your “.edu” email when you apply for the program! After your acceptance into the program, you will immediately have access to the discounted pricing plans.&lt;/p&gt;

&lt;h3&gt;
  
  
  API Provider Eligibility
&lt;/h3&gt;

&lt;p&gt;API Providers interested in being a part of the program can get started in a few simple steps:&lt;/p&gt;

&lt;p&gt;1: Create a Custom Pricing Plan for Students&lt;/p&gt;

&lt;p&gt;Navigate to your &lt;a href="https://provider.rapidapi.com/"&gt;RapidAPI Provider Dashboard&lt;/a&gt; and select the &lt;strong&gt;Plans &amp;amp; Pricing&lt;/strong&gt; tab of your API.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Tjhe4YSY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.shortpixel.ai/client/q_glossy%2Cret_img%2Cw_1600/https://rapidapi.com/blog/wp-content/uploads/2019/10/school-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Tjhe4YSY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.shortpixel.ai/client/q_glossy%2Cret_img%2Cw_1600/https://rapidapi.com/blog/wp-content/uploads/2019/10/school-1.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Scroll to the bottom of the page to the &lt;strong&gt;Private Plans&lt;/strong&gt; section and select &lt;strong&gt;+Add Private Plan&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GFCpDG8_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.shortpixel.ai/client/q_glossy%2Cret_img%2Cw_1600/https://rapidapi.com/blog/wp-content/uploads/2019/10/school-2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GFCpDG8_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.shortpixel.ai/client/q_glossy%2Cret_img%2Cw_1600/https://rapidapi.com/blog/wp-content/uploads/2019/10/school-2.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Create a new subscription called &lt;strong&gt;“CUSTOM-STUDENT”&lt;/strong&gt; that includes your desired pricing plan.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QHlSYP2N--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.shortpixel.ai/client/q_glossy%2Cret_img%2Cw_1600/https://rapidapi.com/blog/wp-content/uploads/2019/10/school-3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QHlSYP2N--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.shortpixel.ai/client/q_glossy%2Cret_img%2Cw_1600/https://rapidapi.com/blog/wp-content/uploads/2019/10/school-3.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We recommend using a free pricing plan, with a hard rate limit on the number of requests/billing objects allowed. This will ensure students won’t incur an overage fee on accident.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;2: Email Us and Say You Want to Join RapidAPI School&lt;/p&gt;

&lt;p&gt;Send us an email at &lt;a href="//mailto:support@rapidapi.com"&gt;support@rapidapi.com&lt;/a&gt; and let us know you want to be part of the program. You can also ask us any questions you have about the program or our recommended pricing model.&lt;/p&gt;

&lt;h2&gt;
  
  
  Future Plans for RapidAPI School
&lt;/h2&gt;

&lt;p&gt;As RapidAPI School continues to evolve, we hope to add more benefits to help support our student community. Our current plans for the program include:&lt;/p&gt;

&lt;p&gt;1: Continuing to expand the number of APIs that have student pricing plans&lt;br&gt;
2: Creating more educational resources for students and beginners&lt;br&gt;
3: Posting more tutorials about how to use RapidAPI and APIs on the RapidAPI Marketplace&lt;/p&gt;

&lt;p&gt;If you have any suggestions or ideas about other benefits you would like to see in the RapidAPI School program, please let us know at &lt;a href="//mailto:support@rapidapi.com"&gt;support@rapidapi.com&lt;/a&gt;, or send us a message on &lt;a href="https://twitter.com/Rapid_API"&gt;Twitter&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Creating an API with AWS Lambda and RapidAPI [Tutorial]</title>
      <dc:creator>Alex Walling</dc:creator>
      <pubDate>Wed, 18 Sep 2019 22:33:32 +0000</pubDate>
      <link>https://dev.to/alexwalling/creating-an-api-with-aws-lambda-and-rapidapi-tutorial-3a1e</link>
      <guid>https://dev.to/alexwalling/creating-an-api-with-aws-lambda-and-rapidapi-tutorial-3a1e</guid>
      <description>&lt;p&gt;Lately, I’ve been really interested in serverless technology and the various use cases that would be ideal to use it for. I had a project come up that was going to be a perfect use case for it, so I decided to dive right in and learn all about AWS Lambda! &lt;/p&gt;

&lt;p&gt;Unfortunately, as I was getting started with the project, I couldn’t find very many good, up to date, resources around exactly how to create an API using AWS Lambda and API Gateway. After learning the ins and outs of how to accomplish this, I decided to write my own blog post for others who are trying to learn too.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating the Lambda Function
&lt;/h2&gt;

&lt;p&gt;To get started, first sign in to AWS console, navigate to the &lt;a href="https://us-west-1.console.aws.amazon.com/lambda/home" rel="noopener noreferrer"&gt;Lambda page&lt;/a&gt;, and create a new Lambda function. For the “role” of your Lambda function, I would recommend that you create a new role from a template and use the Basic Edge Lambda Permissions template. If your API needs to write to S3 or do any more complex operations, you may need to grant your Lambda function more permissions. To learn more about Lambda function permissions, here is an &lt;a href="https://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html" rel="noopener noreferrer"&gt;interesting doc from Amazon&lt;/a&gt; about it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FAR5LAD7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FAR5LAD7.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The most basic version of an API would be an API that simply allows you to call the API and return a 200 response with a body of “hello from AWS Lambda!” To achieve this functionality with a Lambda function, here’s the code you’ll input to do this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;exports&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;handler&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt;    &lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;responseBody&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt;        &lt;/span&gt;&lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hello from AWS Lambda!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="err"&gt;    &lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="err"&gt;    &lt;/span&gt;&lt;span class="nf"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="err"&gt;        &lt;/span&gt;&lt;span class="na"&gt;statusCode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="err"&gt;        &lt;/span&gt;&lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;x-custom-header&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;my custom header value&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="err"&gt;        &lt;/span&gt;&lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;responseBody&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="err"&gt;    &lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is pretty straightforward code where you’re using the callback parameter result of successful function execution. That includes a status code of 200 along with headers and a body. All of this information will be sent as a response to the code that called your API in the first place.&lt;/p&gt;

&lt;h3&gt;
  
  
  Parsing Params and Headers in Lambda Function
&lt;/h3&gt;

&lt;p&gt;With some API requests, your API may be sent parameters or headers to change the functionality of the API. If this is the case for the API you want to build, then you’ll need to access the headers and parameters through the event parameter. You can use the following code to access these variables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;parameter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;queryStringParameters&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;name_of_parameter&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;header&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;headers&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;name_of_header&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="c1"&gt;// OR&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;paramter2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;queryStringParameters&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name_of_parameter_one&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;header2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name_of_header_one&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Creating the API Gateway
&lt;/h2&gt;

&lt;p&gt;Now that you have the code for the Lambda function, you’ll need to set up the &lt;a href="https://blog.rapidapi.com/api-glossary/api-gateway/" rel="noopener noreferrer"&gt;API gateway&lt;/a&gt; which will be what initiates the Lambda code. Go to the &lt;a href="https://us-west-2.console.aws.amazon.com/apigateway/home" rel="noopener noreferrer"&gt;AWS API Gateway&lt;/a&gt; page and create a new API.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FZC3j3NK.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FZC3j3NK.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you’ve created your API, you need to start defining the spec of the API.&lt;/p&gt;

&lt;h3&gt;
  
  
  Proxy API vs. Defined API
&lt;/h3&gt;

&lt;p&gt;There are two different ways to set up your API and each one has it’s own benefits. The two types are “proxy resource” and “fully defined API”&lt;/p&gt;

&lt;h4&gt;
  
  
  Proxy API
&lt;/h4&gt;

&lt;p&gt;When defining a new resource, you have the option to configure it as a proxy resource.&lt;/p&gt;

&lt;p&gt;This means that your API gateway will route every single HTTP requests that include your base URL to your Lambda integration, then your Lambda integration will do the heavy lifting to process the different types of requests.&lt;/p&gt;

&lt;p&gt;Let’s say your base URL is &lt;a href="https://api.myapi.com/" rel="noopener noreferrer"&gt;https://api.myapi.com/&lt;/a&gt; and then you have a GET request to &lt;a href="https://api.myapi.com/hello" rel="noopener noreferrer"&gt;https://api.myapi.com/hello&lt;/a&gt; and POST request &lt;a href="https://api.myapi.com/goodbye" rel="noopener noreferrer"&gt;https://api.myapi.com/goodbye&lt;/a&gt;. Although these are both different HTTP methods to different resources, when using the proxy resource integration your lambda function will be executed for both of these requests.&lt;/p&gt;

&lt;p&gt;The upside to this setup is that you are able to route multiples paths to the same Lambda integration. If you already have a codebase setup in this way it will be an easy way to get started with serverless technology without having to completely refactor your code.&lt;/p&gt;

&lt;p&gt;There are quite a few downsides that you should know though. Some of these downsides include: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The code for your Lambda function will be large as you’re having to handle all of the logic paths in the code. &lt;/li&gt;
&lt;li&gt;You’re paying to run the routing in the Lambda function instead of allowing the API gateway to do it for you. &lt;/li&gt;
&lt;li&gt;You’re not utilizing a lot of the features of the API gateway like API documentation.&lt;/li&gt;
&lt;/ul&gt;

&lt;h5&gt;
  
  
  Parsing different endpoints within the same Lambda function
&lt;/h5&gt;

&lt;p&gt;If you do end up using the proxy integration feature, then you’ll need to do your own logic to handle each endpoint in a different manner. You will access the API request path information in a similar way to how you accessed the header and parameter information. The code to do this is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;nameOfPath&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;path&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="c1"&gt;// OR&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;nameOfPath2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Should you go with this option, you will likely want to use if statements to handle each different path available and have a catch-all else statement to handle any non-defined API endpoints. This could look something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;exports&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;handler&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/hello&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;statusCode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/goodbye&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;statusCode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;goodbye&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;statusCode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;404&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt; 
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Fully Defined API
&lt;/h4&gt;

&lt;p&gt;The other option is to define each of your API endpoints within the API Gateway. This will allow you to restrict the endpoints that are able to be called to only the endpoints you define. You can also have a different Lambda function for each of your endpoints.&lt;/p&gt;

&lt;p&gt;I decided to add in a new resource called “/my-resource”&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FXgn1Cak.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FXgn1Cak.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When defining the resource, you’ll just need to input the resource name and resource path. Since we’re not using the proxy resource, you can leave that unchecked.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FtcYfmIo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FtcYfmIo.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After you’ve created your resource, you’ll want to create a method for that resource.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FbFhaL7Z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FbFhaL7Z.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I’ve opted to use a GET request to my /my-resource endpoint.&lt;/p&gt;

&lt;p&gt;When creating a new method, be sure that you use the Lambda Proxy integration. This allows the parameters and headers to be sent to your Lambda function. You’ll also want to select the Lambda function you want to activate when this endpoint is called.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2F6lPTVj4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2F6lPTVj4.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you’ve defined all of your API endpoints, you need to deploy your API.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FPq1MAVQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FPq1MAVQ.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When Deploying, you’ll have to create a new stage to deploy your API. I’ve decided to name mine Staging because I am still in the development phase, but you can name your API stage whatever you like.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FSj5YLo8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FSj5YLo8.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After deploying your API, you should now see an “Invoke URL” This is the URL that you will use to call your API. The format to call the API will be your Invoke URL followed by your resource name: &lt;a href="https://qa397wgn73.execute-api.us-west-1.amazonaws.com/Staging/my-resource" rel="noopener noreferrer"&gt;https://qa397wgn73.execute-api.us-west-1.amazonaws.com/Staging/my-resource&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Making your First Request
&lt;/h2&gt;

&lt;p&gt;You can now make a GET request to the base URL of your API which will look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FaabSShN.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FaabSShN.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding API Key Authentication with RapidAPI
&lt;/h2&gt;

&lt;p&gt;One way to authenticate requests would be to do it through the API gateway and set up new API keys there. This is fairly straightforward to do, but if you ever want to allow other developers to consume this API, then it becomes difficult to generate new API keys and manage all of the different active API keys you have. You’ll also have to think about whether or not you want to charge for usage of the API, which then envolves handling payments and invoicing.&lt;/p&gt;

&lt;p&gt;A great tool to do user management, API key generation, analytics, and billing for you is a tool called &lt;a href="https://rapidapi.com/" rel="noopener noreferrer"&gt;RapidAPI&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To start, you’ll need to be logged in to &lt;a href="https://rapidapi.com/" rel="noopener noreferrer"&gt;RapidAPI&lt;/a&gt;. Once you’ve created an account, you can head over to our documentation on &lt;a href="https://docs.rapidapi.com/docs/getting-started" rel="noopener noreferrer"&gt;Adding and Managing Your API&lt;/a&gt;. This will detail exactly how you’ll want to add your API to the RapidAPI marketplace. The basic steps are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create &amp;amp; name your API&lt;/li&gt;
&lt;li&gt;Add the base URL for your API

&lt;ul&gt;
&lt;li&gt;This is going to be the Invoke URL from your AWS API Gateway.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Document all of the endpoints your API has available

&lt;ul&gt;
&lt;li&gt;This is going to be all of the resources and methods you’ve defined for your API.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now that your API has been documented for consumption through RapidAPI, you’re ready to set up &lt;a href="https://blog.rapidapi.com/api-glossary/api-authentication/" rel="noopener noreferrer"&gt;authentication&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The beauty of RapidAPI is that we handle all user management and billing for you! That means as long as you set up a &lt;a href="https://docs.rapidapi.com/docs/pricing-your-api-1" rel="noopener noreferrer"&gt;pricing plan&lt;/a&gt; and API access according to how you want to allow developers to access the API, then all you have to do is authenticate if a request is coming from RapidAPI in your code. Since we do all of the authentications before an API request is made to your systems, then you can allow any request coming from the RapidAPI systems to successfully call your API.&lt;/p&gt;

&lt;p&gt;The easiest way to do this is to use our &lt;a href="https://docs.rapidapi.com/docs/headers-sent-by-mashape-proxy" rel="noopener noreferrer"&gt;secret hidden header&lt;/a&gt; called “X-RapidAPI-Proxy-Secret” which is a unique secret key sent with every API request to your systems. The developers using your API will never see this key and the key is unique to every API. To find your X-RapidAPI-Proxy-Secret, go to your API settings page in the &lt;a href="//provider.rapidapi.com"&gt;RapidAPI Provider Dashboard&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To use this key to authenticate requests as coming from RapidAPI, you’ll just want to do a quick check right when a request comes in to see if the X-RapidAPI-Proxy header is present and matches your unique key. Here’s the code to do that:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;exports&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;handler&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;headers&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;X-RapidAPI-Proxy-Secret&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;*******************&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;statusCode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;401&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Unauthorized&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// You API logic goes here&lt;/span&gt;
        &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;queryStringParameters&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

        &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;responseBody&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hello &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;};&lt;/span&gt;
        &lt;span class="nf"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;statusCode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;responseBody&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On top of easily adding user authentication and API key management, you also get the benefit of automatically exposing your API to our large developer community that would be thrilled to use your awesome API! If you get your API up and running on the marketplace, we would love to hear all about it! Feel free to email us at &lt;a href="mailto:community@rapidapi.com"&gt;community@rapidapi.com&lt;/a&gt; to let us know about any APIs you’ve added on RapidAPI or projects you’re working on that use an API through RapidAPI.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>aws</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to Use an API in Google Sheets – RapidAPI for Google Sheets</title>
      <dc:creator>Alex Walling</dc:creator>
      <pubDate>Thu, 12 Sep 2019 23:44:31 +0000</pubDate>
      <link>https://dev.to/alexwalling/how-to-use-an-api-in-google-sheets-rapidapi-for-google-sheets-5h27</link>
      <guid>https://dev.to/alexwalling/how-to-use-an-api-in-google-sheets-rapidapi-for-google-sheets-5h27</guid>
      <description>&lt;p&gt;In this article, you'll learn how to use an API from RapidAPI right in Google Sheets.&lt;/p&gt;

&lt;p&gt;Google Sheets can be a very powerful tool for storing, managing and transforming all kinds of data. I use it all the time for tracking my monthly spending, potential conferences RapidAPI might sponsor, emails of partnership leads, my yearly goals, and much more! With Google Sheets being such a useful tool already, we wanted to help enable anyone to supercharge their sheets through the power of APIs.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://googlesheets.rapidapi.com/" rel="noopener noreferrer"&gt;RapidAPI add-on for Google Sheets&lt;/a&gt; allows you to make API requests to any API on RapidAPI from within a Google Sheet, and embed the data you get back into the sheet - all through a single function that can be dragged down across many rows&lt;/p&gt;

&lt;p&gt;This tutorial will walk you through the basics of using the add-on.&lt;/p&gt;

&lt;h2&gt;
  
  
  1) Installing the Plugin
&lt;/h2&gt;

&lt;p&gt;To install the plugin, simply head to the Google Sheets add-on store and install the &lt;a href="https://chrome.google.com/webstore/detail/rapidapi-for-google-sheet/niplaodlmdnbohiabbnknjienppmbpfl" rel="noopener noreferrer"&gt;free RapidAPI for Google Sheets add-on&lt;/a&gt;. During the installation process, there will be a prompt to accept permissions to run - which are required because this add-on makes requests to external APIs.&lt;br&gt;
By default, the add-on will be disabled in any new spreadsheets that you create. Before using it in a new spreadsheet, you must enable it for that document. To do so:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the sheet you want to use the add-on in.&lt;/li&gt;
&lt;li&gt;Open the “Add-ons” menu at the top of the window.&lt;/li&gt;
&lt;li&gt;Click “Manage Add-ons”&lt;/li&gt;
&lt;li&gt;You should see the RapidAPI Add-on there - click the green “Manage” button next to it and select “Use in this document”. Once selected it should have a check next to it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.rapidapi.com%2Fwp-content%2Fuploads%2F2019%2F05%2FScreen-Shot-2019-04-23-at-10.55.38-AM.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.rapidapi.com%2Fwp-content%2Fuploads%2F2019%2F05%2FScreen-Shot-2019-04-23-at-10.55.38-AM.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  2) Forming the Request
&lt;/h2&gt;

&lt;p&gt;The RapidAPI Google Sheets Add-on supports two different types of functions&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;=GET(url, selectPaths, rapidApiKey)
=GETARR(url, arrPath, selectPaths, rapidApiKey)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The main difference between the two functions is how the response of the data is displayed. If an API has a single object as the response, then you will use the GET function. If the API returns an object that contains an array of values, then you will use the GETARR function.&lt;/p&gt;

&lt;p&gt;For this tutorial, we’ll be using the GETARR functionality to search the &lt;a href="https://rapidapi.com/imdb/api/movie-database-imdb-alternative" rel="noopener noreferrer"&gt;Movie Database (IMDB Alternative) API&lt;/a&gt; to get information about a movie search term.&lt;/p&gt;

&lt;h2&gt;
  
  
  3) Subscribing to the API
&lt;/h2&gt;

&lt;p&gt;Before being able to make a request to the API, you’ll first need to subscribe to an API plan. To do that, use the ‘&lt;a href="https://rapidapi.com/imdb/api/movie-database-imdb-alternative/pricing" rel="noopener noreferrer"&gt;Pricing&lt;/a&gt;’ tab. There are four different pricing plans currently available for the API we’re using for this example. The most affordable plan is a free BASIC plan, which allows for 1,000 calls per month and $0.01 for each additional request over 1,000. The plan that allows you the highest amount of requests is the $10 per month MEGA plan, which enables you to make unlimited API calls.&lt;/p&gt;

&lt;p&gt;If the API you are using does have an overage fee associated, please be sure to be careful about the number of requests that your account is making. You will be charged for any additional usage. You can keep track of your quota in your &lt;a href="https://dashboard.rapidapi.com/" rel="noopener noreferrer"&gt;RapidAPI Developer Dashboard&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Please note. Every time the Google Sheet is opened, the Google Script request is run. What this means is another API request will be made. Make sure you are aware of this when implementing RapidAPI into your Google Sheet.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  4) Gathering the Required Information
&lt;/h2&gt;

&lt;p&gt;For the GETARR function, at the bare minimum requires the url, arrPath, selectPaths, and rapidApiKey. You are also able to provide optional and required query string parameters too. All of this information can easily be found on the &lt;a href="https://rapidapi.com/imdb/api/movie-database-imdb-alternative" rel="noopener noreferrer"&gt;API's listing page&lt;/a&gt; from RapidAPI. Here’s where you can locate the information:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;URL: "https://rapidapi.com/imdb/api/movie-database-imdb-alternative"
arrPath: "Search"
selectPath: "imdbID,Title,Year,Poster"
rapidApiKey: "*****************************"
requiredParameters: "s",{Cell Containing Search Term}
optionalParameters: "page","1","r","json"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this information in hand, you’re ready to start forming your request! Here’s what the full request will look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;=GETARR("https://movie-database-imdb-alternative.p.rapidapi.com/","Search","imdbID,Title,Year,Poster","*********************","page","1","r","json","s",B3)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One thing to note here is that after entering all of the required values &lt;em&gt;[url, arrPath, selectPaths, rapidApiKey]&lt;/em&gt;, you are able to provide the optional and required query string parameters in the following format:  ,“key”,”value”,”key2”,”value2” ,etc.&lt;/p&gt;

&lt;p&gt;When I’m utilizing this tool, I like to format the Spreadsheet by using a cell for the search term since it is the dynamic parameter. This makes it easy to update that particular cell and get a new search result.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.rapidapi.com%2Fwp-content%2Fuploads%2F2019%2F05%2FScreen-Shot-2019-05-14-at-2.55.45-PM.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.rapidapi.com%2Fwp-content%2Fuploads%2F2019%2F05%2FScreen-Shot-2019-05-14-at-2.55.45-PM.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.rapidapi.com%2Fwp-content%2Fuploads%2F2019%2F05%2FScreen-Shot-2019-05-14-at-2.54.45-PM.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.rapidapi.com%2Fwp-content%2Fuploads%2F2019%2F05%2FScreen-Shot-2019-05-14-at-2.54.45-PM.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The API request is what fills in the IMDB ID, TITLE, Release Year, and Link columns of this spreadsheet. Then as an added bonus, I use the =IMG() function, that is provided by default in Google Sheets, to add in the image of the movie posters based on the link the API returned!&lt;/p&gt;

&lt;p&gt;I went ahead and created a template for this specific example to help you get started. The template Google Sheet can be found &lt;a href="https://docs.google.com/spreadsheets/d/1ma6f2pVywS_ULpzYBHAk52YXRmVdIY-lL3ZXIzed9BY/edit?usp=sharing" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;With this spreadsheet, you can select ‘Add to Drive’ and follow the instructions in this blog post to help you get started. Once you subscribe and have your API key, just add it to the spreadsheet to see your results. For more example use cases, you can take a look at this example spreadsheet that shows you how you can validate a list of email addresses, find stock information, geocode an address.&lt;/p&gt;

&lt;p&gt;We’re really excited to see the ways in which you will use the RapidAPI Google Sheets plugin! Shoot us a Tweet at &lt;a class="mentioned-user" href="https://dev.to/rapid_api"&gt;@rapid_api&lt;/a&gt; to let us know what you end up building.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
