🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

github.com/moonwoods/currency_api

Package Overview
Dependencies
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/moonwoods/currency_api

Source
Go Modules
Version
v0.0.1
Version published
Created
Source

💵 💷 Currency API 💴 💶

Golang API to check currency details and exchange rates.

At this time, 200 currencies are available and include cryptocoins.

Endpoints

  • localhost:8080/health

    Just returns a 200 indicating that the api is live.

  • localhost:8080/all

    Returns a JSON dictionary of available currencies in the format:

      <currency-code>:<currency-common-name>
    

    Ex:

    {
        ...
        "btc": "Bitcoin",
        "usd": "US Dollar",
        "mxn": "Mexican Peso",
        ...
    }
    
  • localhost:8080/exchange/<currency-code>

    Returns an object that includes the date and a list of exchange with all currencies based off the requested one:

    {
        "date": "2025-02-18",
        "eur": {
            "1inch": 3.9004839,
            "aave": 0.0040031729,
            "ada": 1.35441158,
            "aed": 3.84382391,
            ...
        }
    }
    

To run API

Ensure you have built your binary:

go build -o currency_api .

and then run it with:

./currency_api

Or just run it with:

go run .

FAQs

Package last updated on 18 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts