marketdataapp / sdk-php
PHP SDK for MarketData.app
Fund package maintenance!
MarketDataApp
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.8
- nesbot/carbon: ^3.6
Requires (Dev)
- phpunit/phpunit: ^10.3.2
- dev-main
- v0.6.2-beta
- v0.6.1-beta
- v0.6.0-beta
- v0.5.0-beta
- v0.4.4-beta
- v0.4.3-beta
- v0.4.2-beta
- v0.4.1-alpha
- v0.4.0-alpha
- v0.3.0-alpha
- v0.2.0-alpha
- v0.1.0-alpha
- dev-dependabot/composer/phpunit/phpunit-tw-11.4.0
- dev-update-php-docs
- dev-customize-phpdoc-template
- dev-dependabot/github_actions/actions/checkout-4
- dev-dependabot/github_actions/peter-evans/create-pull-request-7
- dev-delete-old-docs
- dev-add-phpdocs
This package is auto-updated.
Last update: 2024-11-07 09:44:58 UTC
README
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.