承接 d1am0nd/alpha-vantage 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

d1am0nd/alpha-vantage

最新稳定版本:0.1.2

Composer 安装命令:

composer require d1am0nd/alpha-vantage

包简介

Simplified Laravel Alpha Vantage API client

README 文档

README

This is a Laravel package for simplified fetching of finance data from Alpha Vantage API. It's an abstraction layer over Guzzle that aims to remove complexity in connecting it to Alpha Vantage API.

Docs

Demo

Getting historical data

// Daily historical data for Bitcoin to USD
$res = \AlphaVantage\Api::digitalCurrency()->daily('BTC', 'USD');
/* Returns
[
    "Meta Data": [
        "1. Information": "Daily Prices and Volumes for Digital Currency", ...
    ],
    "Time Series (Digital Currency Daily)": [
        "2018-01-03": [
            "1a. open (USD)": "14782.09572045", ...
        ],
        "2018-01-02": [
            "1a. open (USD)": "13514.39967186", ...
        ], ...
    ],
]
*/

Installation

  1. Run composer composer require d1am0nd/alpha-vantage
  2. Add your Alpha Vantage API key to .env as AV_KEY={your key}

Usage

API calls are grouped into 5 different groups:

Each function described below is called from their respective group as shown in examples.

Functions described below also take an additional parameter array $params = [], which can be used to pass any optional parameters if needed.

Stock Time Series

Documented - https://www.alphavantage.co/documentation/#currency-exchange

Example - Microsoft's historical monthly stock data

use AlphaVantage\Api;
// ...
public function monthlyData()
{
    return Api::stock()->monthly('MSFT');
}

Methods available

Foreign Exchange

Documented - https://www.alphavantage.co/documentation/#currency-exchange

Example - Euro to US Dollar

use AlphaVantage\Api;
// ...
public function currencyExchangeRate()
{
    return Api::currency()->currencyExchangeRate('EUR', 'USD');
}

Methods available

Digital & Crypto Currencies

Documented - https://www.alphavantage.co/documentation/#digital-currency

Example - Bitcoin historical monthly stock data

use AlphaVantage\Api;
// ...
public function monthlyData()
{
    return Api::digitalCurrency()->monthly('BTC', 'USD');
}

Methods available

Sector Performances

Documented - https://www.alphavantage.co/documentation/#sector-information

Example - Sector peformances

use AlphaVantage\Api;
// ...
public function sectorPerformances()
{
    return Api::sector()->sectors();
}

Methods available

Technical Indicators & Other

Documented - https://www.alphavantage.co/documentation/#technical-indicators

Technical methods are not implemented as separate functions. There is a Api::general()->query($funcName, array $params) method which allows for custom queries.

Example - MACDEXT

This will query function 'MACDEXT' with additional parameters symbol, interval and series_type as described in the documentation https://www.alphavantage.co/documentation/#macdext

use AlphaVantage\Api;
// ...
public function technicalIndicators()
{
    return Api::general()->query('MACDEXT', [
        'symbol' => 'MSFT',
        'interval' => '15min',
        'series_type' => 'high',
    ]);
}

Methods available

  • query($functionName, array $parameters)

License

This project is licensed under the MIT License - see the LICENSE.md file for details

统计信息

  • 总下载量: 2.98k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 10
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 10
  • Watchers: 1
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固