Code Monkey home page Code Monkey logo

alphavantage-adapter's Introduction

Alpha Vantage External Adapter

External Adapter for Chainlink to query Alpha Vantages' APIs.

Built with Bridges.

https://www.alphavantage.co/documentation/

To give Alpha Vantages own description:

Composed of a tight-knit community of researchers, engineers, and business professionals, Alpha Vantage Inc. is a leading provider of free APIs for realtime and historical data on stocks, forex (FX), and digital/crypto currencies. Our success is driven by rigorous research, cutting edge technology, and a disciplined focus on democratizing access to data.

Contract Usage

To use this adapter on-chain, find a node that supports this adapter and build your request like so:

Chainlink.Request memory req = buildChainlinkRequest(jobId, this, this.fulfill.selector);
run.add("function", "GLOBAL_QUOTE");
run.add("symbol", "MSFT");
string[] memory copyPath = new string[](2);
copyPath[0] = "Global Quote";
copyPath[1] = "05. price";

Setup Instructions

Local Install

Make sure Golang is installed.

Build:

make build

Then run the adapter:

API_KEY=apikey ./alphavantage-adapter

Docker

To run the container:

docker run -it -e API_KEY=apikey -p 8080:8080 linkpool/alphavantage-adapter

Container also supports passing in CLI arguments.

You can add and modify the keys to match what's specified in the API documentation.

Usage

curl -X POST -H 'Content-Type: application/json' \
-d @- << EOF
{
	"jobRunId": "1234",
	"data": {
		"function": "GLOBAL_QUOTE",
		"symbol": "MSFT"
	}
}
EOF

Response:

{
    "jobRunId": "1234",
    "status": "completed",
    "error": null,
    "pending": false,
    "data": {
        "Global Quote": {
            "01. symbol": "MSFT",
            "02. open": "133.7900",
            "03. high": "135.6500",
            "04. low": "131.8284",
            "05. price": "135.2800",
            "06. volume": "26682074",
            "07. latest trading day": "2019-08-07",
            "08. previous close": "134.6900",
            "09. change": "0.5900",
            "10. change percent": "0.4380%"
        },
        "function": "GLOBAL_QUOTE",
        "symbol": "MSFT"
    }
}

alphavantage-adapter's People

Contributors

jleeh avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.