Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.
/ stocks-php Public archive

PHP wrapper for the Equibles stocks API.

Notifications You must be signed in to change notification settings

equibles/stocks-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EquiblesStocks

Requirements

PHP 5.5 and later

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/equibles/stocks-php.git"
    }
  ],
  "require": {
    "equibles/stocks-php": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/EquiblesStocks/vendor/autoload.php');

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: Query String
$config = EquiblesStocks\Configuration::getDefaultConfiguration()->setApiKey('apiKey', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = EquiblesStocks\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer');

$apiInstance = new EquiblesStocks\Clients\ExchangesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$apiKey = "apiKey_example"; // string | 

try {
    $result = $apiInstance->callList($apiKey);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ExchangesApi->callList: ', $e->getMessage(), PHP_EOL;
}

// Configure API key authorization: Query String
$config = EquiblesStocks\Configuration::getDefaultConfiguration()->setApiKey('apiKey', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = EquiblesStocks\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer');

$apiInstance = new EquiblesStocks\Clients\ExchangesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$apiKey = "apiKey_example"; // string | 

try {
    $result = $apiInstance->currencies($apiKey);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ExchangesApi->currencies: ', $e->getMessage(), PHP_EOL;
}

// Configure API key authorization: Query String
$config = EquiblesStocks\Configuration::getDefaultConfiguration()->setApiKey('apiKey', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = EquiblesStocks\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer');

$apiInstance = new EquiblesStocks\Clients\ExchangesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$apiKey = "apiKey_example"; // string | 
$operatingMic = "operatingMic_example"; // string | The operating MIC of the exchange to search.

try {
    $result = $apiInstance->stocks($apiKey, $operatingMic);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ExchangesApi->stocks: ', $e->getMessage(), PHP_EOL;
}
?>

Documentation for API Endpoints

All URIs are relative to https://api.equibles.com

Class Method HTTP request Description
ExchangesApi callList GET /stocks/exchanges/list List Exchanges
ExchangesApi currencies GET /stocks/exchanges/currencies List Currencies
ExchangesApi stocks GET /stocks/exchanges/stocks List Stocks
FundamentalsApi dividends GET /stocks/fundamentals/dividends Dividends
FundamentalsApi financialReports GET /stocks/fundamentals/financialreports Financial Statements
MetricsApi priceToEarnings GET /stocks/metrics/pricetoearnings Historical P/E
NewsApi callList GET /stocks/news/list List News
NewsApi publishers GET /stocks/news/publishers List Publishers
PerformanceApi callList GET /stocks/performance/list Performance
PricesApi endOfDay GET /stocks/prices/endofday End Of Day Prices
PricesApi intraday GET /stocks/prices/intraday Intraday Prices
PricesApi summary GET /stocks/prices/summary Latest trading day summary
SectorsApi callList GET /stocks/sectors/list List Sectors
SectorsApi searchStocks GET /stocks/sectors/searchstocks List Stocks
StocksApi callList GET /stocks/list List Stocks
StocksApi officers GET /stocks/officers Officers
StocksApi profile GET /stocks/profile Profile
StocksApi screener POST /stocks/screener Screener
StocksApi search GET /stocks/search Search
StocksApi splits GET /stocks/splits Splits
TransactionsApi insiders GET /stocks/transactions/insiders Insider Transactions
TransactionsApi institutional GET /stocks/transactions/institutional Institutional Transactions

Documentation For Models

Documentation For Authorization

Query String

  • Type: API key
  • API key parameter name: apiKey
  • Location: URL query string

Author

contact@equibles.com

About

PHP wrapper for the Equibles stocks API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published