marketdataapp/sdk-php 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

marketdataapp/sdk-php

最新稳定版本:v0.6.2-beta

Composer 安装命令:

composer require marketdataapp/sdk-php

包简介

PHP SDK for MarketData.app

README 文档

README

Latest Version on Packagist Tests Codecov Total Downloads

This is the official PHP SDK for Market Data. It provides developers with a powerful, easy-to-use interface to obtain real-time and historical financial data. Ideal for building financial applications, trading bots, and investment strategies.

Installation

You can install the package via composer:

composer require MarketDataApp/sdk-php

Usage

$client = new MarketDataApp\Client('your_api_token');

// Indices
$quote = $client->indices->quote('VIX');
$quotes = $client->indices->quotes(['VIX', 'DJI']);
$candles = $client->indices->candles(
    symbol: "VIX",
    from: '2022-09-01',
    to: '2022-09-05',
    resolution: 'D'
);

// Stocks
$candles = $client->stocks->candles('AAPL');
$bulk_candles = $client->stocks->bulkCandles(['AAPL, MSFT']);
$quote = $client->stocks->quote('AAPL');
$quotes = $client->stocks->quotes(['AAPL', 'MSFT']);
$bulk_quotes = $client->stocks->bulk_quotes(['AAPL', 'MSFT']);
$earnings = $client->stocks->earnings(symbol: 'AAPL', from: '2023-01-01');
$news = $client->stocks->news(symbol: 'AAPL', from: '2023-01-01');

// Markets
$status = $client->markets->status(date: '2023-01-01');

// Mutual Funds
$candles = $client->mutual_funds->candles(
    symbol: 'VFINX',
    from: '2022-09-01',
    to: '2022-09-05',
    resolution: 'D'
);

// Options
$expirations = $client->options->expirations('AAPL');
$lookup = $client->options->lookup('AAPL 7/28/23 $200 Call');
$strikes = $client->options->strikes(
    symbol: 'AAPL',
    expiration: '2023-01-20',
    date: '2023-01-03',
);
$option_chain = $client->options->option_chain(
    symbol: 'AAPL',
    expiration: '2025-01-17',
    side: Side::CALL,
);
$quotes = $client->options->quotes('AAPL250117C00150000');

// Utilities
$status = $client->utilities->api_status();
$headers = $client->utilities->headers();

Universal Parameters

All endpoints (other than utilities) supports universal parameters.

For instance, you can change the format to CSV

$option_chain = $client->options->option_chain(
    symbol: 'AAPL',
    expiration: '2025-01-17',
    side: Side::CALL,
    parameters: new Parameters(format: Format::CSV),
);

Testing

./vendor/bin/phpunit

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-07-08