Skip to main content

Create a BTC/ETH price & USD exchange rate API with CoinGecko & ExchangeRate-API

Workflow preview

Workflow preview
100%
Create a BTC/ETH price & USD exchange rate API with CoinGecko & ExchangeRate-API preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Crypto + FX Micro API (Webhook JSON) Overview Spin up a tiny, serverless style API from n8n that returns BTC/ETH prices & 24h changes plus USD→EUR and USD→NGN from public, no key data sources...

Best for

  • Crypto Trading automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.webhook, n8n-nodes-base.httprequest, n8n-nodes-base.merge, n8n-nodes-base.code, n8n-nodes-base.respondtowebhook, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by David Olusola.

Original n8n.io source

1.1 Workflow description

Title
Create a BTC/ETH price & USD exchange rate API with CoinGecko & ExchangeRate-API
Workflow name
Create a BTC/ETH price & USD exchange rate API with CoinGecko & ExchangeRate-API

🌐 Crypto + FX Micro-API (Webhook JSON)

📌 Overview

Spin up a tiny, serverless-style API from n8n that returns BTC/ETH prices & 24h changes plus USD→EUR and USD→NGN from public, no-key data sources. Ideal for dashboards, low-code apps, or internal tools that just need a simple JSON feed.

⚙️ How it works

  1. Webhook (GET /crypto-fx) — entrypoint for your client/app.
  2. HTTP: ExchangeRate-API — USD-base FX rates (no API key).
  3. HTTP: CoinGecko — BTC/ETH prices + 24h % change (no API key).
  4. Merge — combines payloads.
  5. Code (v2) — shapes a clean JSON:
    • btc.price, btc.change_24h
    • eth.price, eth.change_24h
    • usd_eur, usd_ngn, ts (ISO timestamp)
  6. Respond to Webhook — returns the JSON with HTTP 200.

🛠 Setup Guide

  1. Webhook path & URL In the Webhook node, confirm HTTP Method = GET and Path = crypto-fx. Use the Test URL while building; switch to Production URL for live usage.
  2. Test the endpoint Curl: curl -s https://<your-n8n-host>/webhook/crypto-fx Browser / fetch(): fetch('https://<your-n8n-host>/webhook/crypto-fx') .then(r => r.json()) .then(data => console.log(data))
  3. Response mapping (already wired) Respond to Webhook → Response Body is set to {{$json}}. The Code node outputs the exact JSON structure shown above, so no extra mapping is required.

🔐 Security (recommended) Add a Webhook Secret (query header check in Code node) or IP allowlist via your reverse proxy. If embedding in public sites, proxy through your backend and apply rate-limit/cache headers there.

🚀 Usage ideas Frontend dashboards (Chart.js, ECharts). HomeAssistant / Node-RED info panels. Google Apps Script to store the JSON into Sheets on a timer.

🎛 Customization More coins: extend CoinGecko ids= (e.g., bitcoin,ethereum,solana). More FX: read additional codes from fx.rates and add to the payload. Timestamps: convert ts to your preferred timezone on client side. CORS: if calling from browsers, add CORS headers in Respond (options → headers).

🧩 Troubleshooting Empty/partial JSON: run the two HTTP nodes once to verify responses. 429s / rate limiting: add a short Wait node or cache outputs. Wrong URL: ensure you’re using Production URL outside the n8n editor. Security errors: if you add a secret, return 401 when it’s missing/invalid.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Webhook

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 1

Block 2 - Get Fiat Exchange Rates

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.1

Block 3 - Get Crypto Prices

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.1

Block 4 - Merge

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 5 - Build JSON

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 6 - Respond

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1

Block 7 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Create a BTC/ETH price & USD exchange rate API with CoinGecko & ExchangeRate-API
Complexity intermediate
Nodes 7
Categories Crypto Trading
Author David Olusola
Published 08 Sept 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8389/8389.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Create a BTC/ETH price & USD exchange rate API with CoinGecko & ExchangeRate-API do?

Crypto + FX Micro API (Webhook JSON) Overview Spin up a tiny, serverless style API from n8n that returns BTC/ETH prices & 24h changes plus USD→EUR and USD→NGN from public, no key data sources...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Crypto Trading use case.