Golang Exchange Rates API

Golang Currency API

Get Live Exchange Rates in Go. Fast integration, comprehensive documentation, and reliable exchange rate data for your Go applications.

Batch FX Rates in one request
Real-time Go exchange rates
Historical data support

No card required. Free plan is 500 requests/month

get_exchange_rates.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	resp, err := http.Get("https://currencyapi.net/api/v1/rates?key=YOUR_API_KEY&base=USD&output=JSON")
	if err != nil { log.Fatal(err) }
	defer resp.Body.Close()

	b, err := io.ReadAll(resp.Body)
	if err != nil { log.Fatal(err) }

	fmt.Println(string(b))
}

Trusted by Go developers worldwide

Join thousands of developers who rely on our Currency API for their Go applications, with low latency JSON responses, dependable uptime, and reliable data sources.

Our API powers Go applications across industries—from high-performance microservices to enterprise financial platforms. Built for speed, trusted by developers.

Customers using our Currency API
50M+ Requests Every Month

Built to handle high traffic smoothly and reliably.

10,000+ Happy Customers

Chosen by developers, startups, and growing teams.

Supporting Devs Since 2019

A proven platform you can count on long-term.

~50ms Average Latency

Fast responses for real-time Go services and APIs.

Our Pricing Plans

Get started with our Golang Exchange Rates API for free. Perfect for Go developers building personal projects or testing. Upgrade to paid plans for production Go applications with higher limits, faster updates, and commercial usage rights.

Free

Perfect for personal projects

$0/month
  • 500 monthly requests
  • Hourly updates
  • Fetch currency rates in Go
  • Rate limits (10 req/min)
  • Commercial use
  • Technical support
  • Change base currency
MOST POPULAR

Commercial

Built for production applications

From $9.99/month
  • Up to 10M+ monthly requests
  • Updates as fast as 60 seconds
  • Historical rates back to 2000
  • Official Golang SDK included
  • Convert endpoint for Go
  • Commercial use allowed
  • Technical email support
  • Team management
  • Multiple API keys
  • IP whitelisting/blacklisting

How Our Golang Currency API Works

Sign Up

Sign up for a free account to get started with our API. Paid plans start at just $9.99/month.

Get Your API Key

After signing up, you'll receive an API key. Use this key to authenticate requests to our API endpoints.

Integrate the API

Use our Golang SDK (go get github.com/houseofapis/currencyapi-go) or code samples with the net/http package to quickly integrate.

Getting Started: Golang Integration

Implement our Golang Currency API in your application using either the standard net/http package or our official Go SDK. Both approaches are fully supported and documented.

get_exchange_rates.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	resp, err := http.Get("https://currencyapi.net/api/v1/rates?key=YOUR_API_KEY&base=USD&output=JSON")
	if err != nil { log.Fatal(err) }
	defer resp.Body.Close()

	b, err := io.ReadAll(resp.Body)
	if err != nil { log.Fatal(err) }

	fmt.Println(string(b))
}

Using net/http Package

Use Go's standard net/http package for direct API calls. Simple, straightforward, and requires no additional dependencies beyond the standard library.

Perfect if you prefer full control over HTTP requests or want to keep your Go modules minimal.

Using Our Golang SDK

Our Official Golang SDK (currencyapi-go) provides a clean, idiomatic Go interface with error handling, type safety, and a simple API.

Install with go get github.com/houseofapis/currencyapi-go and enjoy a more intuitive development experience. Perfect for microservices, CLI tools, and any Go application.

sdk_example.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package main

import (
	"fmt"
	"log"
	"github.com/houseofapis/currencyapi-go"
)

func main() {
	client := currencyapi.Client("YOUR_API_KEY")

	body, err := client.Rates(map[string]string{"base": "USD", "output": "JSON"})
	if err != nil { log.Fatal(err) }

	fmt.Println(string(body))
}

AI Assisted Golang Integration

Integrate our Exchange Rates API effortlessly with AI assistants. We provide a simple llms.txt file that contains all the information about our API in a format optimized for AI assistants and Large Language Models.

AI assistants like ChatGPT, Claude, Cursor, Windsurf, and others can quickly understand our API capabilities and help you integrate Currency API more efficiently into your Go applications.

Simply reference our llms.txt file and let AI assistants guide you through Go integration, code examples, and best practices. More information can be found on our LLM Documentation page.

AI Assisted Golang Currency API Integration

What Go Developers Build With Our API

See how Go developers use our Currency API endpoints to power their applications. From real-time rates to historical analysis, discover the possibilities.

get_live_rates.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	resp, err := http.Get("https://currencyapi.net/api/v1/rates?key=YOUR_API_KEY&base=USD&output=JSON")
	if err != nil { log.Fatal(err) }
	defer resp.Body.Close()

	b, err := io.ReadAll(resp.Body)
	if err != nil { log.Fatal(err) }

	fmt.Println(string(b))
}

Live Exchange Rates

Fetch real-time exchange rates for 152+ currencies in a single API call. Perfect for building currency converters, e-commerce pricing engines, and financial dashboards.

Go developers use this endpoint to power real-time currency displays, update product prices dynamically, and build trading applications that need current market rates.

Currency Conversion

Convert a currency from one to another with a single API request. Ideal for checkout flows, invoice generation, and payment processing systems.

Go developers integrate this endpoint into microservices and API backends to handle multi-currency transactions, calculate shipping costs in different currencies, and build international payment gateways.

convert_currency.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	resp, err := http.Get("https://currencyapi.net/api/v1/convert?key=YOUR_API_KEY&from=GBP&to=USD&amount=100&output=JSON")
	if err != nil { log.Fatal(err) }
	defer resp.Body.Close()

	b, err := io.ReadAll(resp.Body)
	if err != nil { log.Fatal(err) }

	fmt.Println(string(b))
}
get_historical_rates.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	resp, err := http.Get("https://currencyapi.net/api/v1/history?key=YOUR_API_KEY&date=2020-01-01&base=USD&output=JSON")
	if err != nil { log.Fatal(err) }
	defer resp.Body.Close()

	b, err := io.ReadAll(resp.Body)
	if err != nil { log.Fatal(err) }

	fmt.Println(string(b))
}

Historical Exchange Rates

Access Historical Exchange Rates for a specific date going back to the year 2000. Essential for financial reporting, backtesting trading strategies, and analyzing currency trends over time.

Go developers use historical data to build various graphs, analytics dashboards, generate financial reports, perform currency trend analysis, and create data visualizations for business intelligence tools.

Timeframe Analysis

The Timeframe Endpoint allows you to retrieve rates for multiple historical dates in one request. Perfect for analyzing currency movements over weeks, months, or years.

Go developers leverage timeframe data to build portfolio tracking tools, create currency performance reports, analyze seasonal trends, and power financial forecasting models in data science applications.

get_timeframe_rates.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	resp, err := http.Get("https://currencyapi.net/api/v1/timeframe?key=YOUR_API_KEY&start_date=2017-12-25&end_date=2018-01-10&base=USD&output=JSON")
	if err != nil { log.Fatal(err) }
	defer resp.Body.Close()

	b, err := io.ReadAll(resp.Body)
	if err != nil { log.Fatal(err) }

	fmt.Println(string(b))
}

Powerful Dashboard for Go Developers

Manage your Go API usage, monitor performance, and access powerful analytics through our intuitive dashboard. Everything you need to optimize your Go currency data integration.

Analytics and Monitoring preview

Dashboard Features

FAQs

Questions about using our API with Go? Below are some of our most asked questions or feel free to get in touch.

How do I install the Golang SDK?

Install our Golang SDK using go get: go get github.com/houseofapis/currencyapi-go. The SDK is available on GitHub and supports Go 1.13 and higher.

Once installed, import it with: import "github.com/houseofapis/currencyapi-go". Then create a client instance with your API key to start making requests.

Do I need to use the SDK, or can I use net/http directly?

You can use either approach! The SDK provides a cleaner, more idiomatic Go interface with built-in error handling and type safety.

If you prefer, you can use the standard net/http package directly with our REST API. Both approaches are fully supported and documented.

Does the Golang SDK support concurrent requests?

Yes, the Golang SDK is fully thread-safe and supports concurrent requests using goroutines.

If you want to find out more, checkout out the code in the Golang SDK GitHub repository.

Can I use this with Gin, Echo, or other Go web frameworks?

Absolutely! Our Golang Currency API works seamlessly with Gin, Echo, Fiber, Chi, and any Go web framework.

You can integrate it into handlers, create middleware, or use it in background workers. Check our Golang SDK Documentation for framework-specific examples.

What Go versions are supported?

Our Golang SDK supports Go 1.13 and higher. For direct API calls using the net/http package, any Go version that supports the standard library will work.

We recommend Go 1.18+ for the best experience and latest language features like generics.

How do I handle errors in Go?

Use Go's standard error handling. The SDK returns errors for API errors, network issues, and invalid requests.

Check errors after each call: body, err := client.Rates(params); if err != nil { log.Fatal(err) }. See our Error Handling Documentation for detailed examples.