RapidAPI

The RapidAPI Developer Hub

Welcome to the RapidAPI developer hub. You'll find comprehensive guides and documentation to help you start working with RapidAPI as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    Documentation

Go

Query RapidAPI using Go

To get started using Go to consume APIs on RapidAPI, run the following command:

go get github.com/RapidSoftwareSolutions/rapidapi-go-sdk/RapidAPISDK

Once you've installed the SDK, require it in your code:

import (
	"github.com/RapidSoftwareSolutions/rapidapi-go-sdk/RapidAPISDK" 
)

You can now instantiate a new RapidAPI client with your ProjectName and ProjectKey:

rapidApi := RapidAPISDK.RapidAPI {'ProjectName', 'ProjectKey'}

Now, to call an API, all you have to do is write the following code:

params := map[string]RapidAPISDK.Param{
	"ParameterKey1": {"data", "ParameterValue1"},
	"ParameterKey2": {"data", "ParameterValue2"},
}
response := rapidApi.Call("APIName", "FuntionName", params)
if response["success"] != nil {
	
} else {
	\\use response["error"]
}

Code Snippets

In the code tab in the functions page, you can select Go to auto-generate a Go code snippet for the function you're currently viewing.

Go

Query RapidAPI using Go