8000 GitHub - KThompso/avs: Alpha Vantage API for Salesforce
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

KThompso/avs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alpha Vantage for SalesForce

CircleCI

Documentation

A simple Apex client library for using the Alpha Vantage API. Alpha Vantage provides free and paid access to financial market data. This project has no direct affiliation with Alpha Vantage. For the full list of functions and parameters used by the AlphaVantage API visit their API documentation.

ApexDocs for this project can be found here.

Alpha Vantage API Documentation can be found here.

Install

This project is provided as an unmanaged SalesForce package. To install:

  1. Clone this repository. git clone https://github.com/KThompso/avs.git
  2. Change the value of the API_KEY variable in AV.cls to your Alpha Vantage API key. Don't have one? Request one for free here.
  3. Build the package: $ (cd avs && make salesforce-package)
  4. Deploy the package directory to your SalesForce org. E.g. using the ForceCLI tool to deploy to your test org:
$ force login -i test && force import -d avs/package/

Examples

HttpResponse resp = AVStock.intraday('MSFT', '5min', null);

if (resp.getStatusCode() == 200) {
    Map<String, Object> m = (Map<String, Object>) JSON.deserializeUntyped(resp.getBody());
    Map<String, Object> timeseries = (Map<String, Object>) m.get('Time Series (5min)');
    
    for (String k : timeseries.keyset()) {
        Map<String, Object> point = (Map<String, Object>) timeseries.get(k);
        System.debug(k + ' : ' + point.get('1. open'));
    }
} else {
    System.debug(LoggingLevel.ERROR, resp.getBody());
}

About

Alpha Vantage API for Salesforce

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0