wenjun1055 / bitmex-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SwaggerClient-php

REST API for the BitMEX Trading Platform View Changelog #### Getting Started Base URI: https://www.bitmex.com/api/v1 ##### Fetching Data All REST endpoints are documented below. You can try out any query right from this interface. Most table queries accept count, start, and reverse params. Set reverse=true to get rows newest-first. Additional documentation regarding filters, timestamps, and authentication is available in the main API documentation. All table data is available via the Websocket. We highly recommend using the socket if you want to have the quickest possible data without being subject to ratelimits. ##### Return Types By default, all data is returned as JSON. Send ?_format=csv to get CSV data or ?_format=xml to get XML data. ##### Trade Data Queries This is only a small subset of what is available, to get you started. Fill in the parameters and click the Try it out! button to try any of these queries. * Pricing Data * Trade Data * OrderBook Data * Settlement Data * Exchange Statistics Every function of the BitMEX.com platform is exposed here and documented. Many more functions are available. ##### Swagger Specification ⇩ Download Swagger JSON ## All API Endpoints Click to expand a section.

This PHP package is automatically generated by the Swagger Codegen project:

  • API version: 1.2.0
  • Build package: io.swagger.codegen.languages.PhpClientCodegen

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/GIT_USER_ID/GIT_REPO_ID.git"
    }
  ],
  "require": {
    "GIT_USER_ID/GIT_REPO_ID": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/SwaggerClient-php/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: apiKey
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
// Configure API key authorization: apiNonce
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-nonce', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-nonce', 'Bearer');
// Configure API key authorization: apiSignature
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-signature', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-signature', 'Bearer');

$apiInstance = new Swagger\Client\Api\APIKeyApi(
    // 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
);
$api_key_id = "api_key_id_example"; // string | API Key ID (public component).

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

?>

Documentation for API Endpoints

All URIs are relative to https://localhost/api/v1

Class Method HTTP request Description
APIKeyApi aPIKeyDisable POST /apiKey/disable Disable an API Key.
APIKeyApi aPIKeyEnable POST /apiKey/enable Enable an API Key.
APIKeyApi aPIKeyGet GET /apiKey Get your API Keys.
APIKeyApi aPIKeyNew POST /apiKey Create a new API Key.
APIKeyApi aPIKeyRemove DELETE /apiKey Remove an API Key.
AnnouncementApi announcementGet GET /announcement Get site announcements.
AnnouncementApi announcementGetUrgent GET /announcement/urgent Get urgent (banner) announcements.
ChatApi chatGet GET /chat Get chat messages.
ChatApi chatGetChannels GET /chat/channels Get available channels.
ChatApi chatGetConnected GET /chat/connected Get connected users.
ChatApi chatNew POST /chat Send a chat message.
ExecutionApi executionGet GET /execution Get all raw executions for your account.
ExecutionApi executionGetTradeHistory GET /execution/tradeHistory Get all balance-affecting executions. This includes each trade, insurance charge, and settlement.
FundingApi fundingGet GET /funding Get funding history.
InstrumentApi instrumentGet GET /instrument Get instruments.
InstrumentApi instrumentGetActive GET /instrument/active Get all active instruments and instruments that have expired in <24hrs.
InstrumentApi instrumentGetActiveAndIndices GET /instrument/activeAndIndices Helper method. Gets all active instruments and all indices. This is a join of the result of /indices and /active.
InstrumentApi instrumentGetActiveIntervals GET /instrument/activeIntervals Return all active contract series and interval pairs.
InstrumentApi instrumentGetCompositeIndex GET /instrument/compositeIndex Show constituent parts of an index.
InstrumentApi instrumentGetIndices GET /instrument/indices Get all price indices.
InsuranceApi insuranceGet GET /insurance Get insurance fund history.
LeaderboardApi leaderboardGet GET /leaderboard Get current leaderboard.
LeaderboardApi leaderboardGetName GET /leaderboard/name Get your alias on the leaderboard.
LiquidationApi liquidationGet GET /liquidation Get liquidation orders.
NotificationApi notificationGet GET /notification Get your current notifications.
OrderApi orderAmend PUT /order Amend the quantity or price of an open order.
OrderApi orderAmendBulk PUT /order/bulk Amend multiple orders for the same symbol.
OrderApi orderCancel DELETE /order Cancel order(s). Send multiple order IDs to cancel in bulk.
OrderApi orderCancelAll DELETE /order/all Cancels all of your orders.
OrderApi orderCancelAllAfter POST /order/cancelAllAfter Automatically cancel all your orders after a specified timeout.
OrderApi orderClosePosition POST /order/closePosition Close a position. [Deprecated, use POST /order with execInst: 'Close']
OrderApi orderGetOrders GET /order Get your orders.
OrderApi orderNew POST /order Create a new order.
OrderApi orderNewBulk POST /order/bulk Create multiple new orders for the same symbol.
OrderBookApi orderBookGetL2 GET /orderBook/L2 Get current orderbook in vertical format.
PositionApi positionGet GET /position Get your positions.
PositionApi positionIsolateMargin POST /position/isolate Enable isolated margin or cross margin per-position.
PositionApi positionTransferIsolatedMargin POST /position/transferMargin Transfer equity in or out of a position.
PositionApi positionUpdateLeverage POST /position/leverage Choose leverage for a position.
PositionApi positionUpdateRiskLimit POST /position/riskLimit Update your risk limit.
QuoteApi quoteGet GET /quote Get Quotes.
QuoteApi quoteGetBucketed GET /quote/bucketed Get previous quotes in time buckets.
SchemaApi schemaGet GET /schema Get model schemata for data objects returned by this API.
SchemaApi schemaWebsocketHelp GET /schema/websocketHelp Returns help text & subject list for websocket usage.
SettlementApi settlementGet GET /settlement Get settlement history.
StatsApi statsGet GET /stats Get exchange-wide and per-series turnover and volume statistics.
StatsApi statsHistory GET /stats/history Get historical exchange-wide and per-series turnover and volume statistics.
StatsApi statsHistoryUSD GET /stats/historyUSD Get a summary of exchange statistics in USD.
TradeApi tradeGet GET /trade Get Trades.
TradeApi tradeGetBucketed GET /trade/bucketed Get previous trades in time buckets.
UserApi userCancelWithdrawal POST /user/cancelWithdrawal Cancel a withdrawal.
UserApi userCheckReferralCode GET /user/checkReferralCode Check if a referral code is valid.
UserApi userConfirm POST /user/confirmEmail Confirm your email address with a token.
UserApi userConfirmEnableTFA POST /user/confirmEnableTFA Confirm two-factor auth for this account. If using a Yubikey, simply send a token to this endpoint.
UserApi userConfirmWithdrawal POST /user/confirmWithdrawal Confirm a withdrawal.
UserApi userDisableTFA POST /user/disableTFA Disable two-factor auth for this account.
UserApi userGet GET /user Get your user model.
UserApi userGetAffiliateStatus GET /user/affiliateStatus Get your current affiliate/referral status.
UserApi userGetCommission GET /user/commission Get your account's commission status.
UserApi userGetDepositAddress GET /user/depositAddress Get a deposit address.
UserApi userGetMargin GET /user/margin Get your account's margin status. Send a currency of &quot;all&quot; to receive an array of all supported currencies.
UserApi userGetWallet GET /user/wallet Get your current wallet information.
UserApi userGetWalletHistory GET /user/walletHistory Get a history of all of your wallet transactions (deposits, withdrawals, PNL).
UserApi userGetWalletSummary GET /user/walletSummary Get a summary of all of your wallet transactions (deposits, withdrawals, PNL).
UserApi userLogout POST /user/logout Log out of BitMEX.
UserApi userLogoutAll POST /user/logoutAll Log all systems out of BitMEX. This will revoke all of your account's access tokens, logging you out on all devices.
UserApi userMinWithdrawalFee GET /user/minWithdrawalFee Get the minimum withdrawal fee for a currency.
UserApi userRequestEnableTFA POST /user/requestEnableTFA Get secret key for setting up two-factor auth.
UserApi userRequestWithdrawal POST /user/requestWithdrawal Request a withdrawal to an external wallet.
UserApi userSavePreferences POST /user/preferences Save user preferences.
UserApi userUpdate PUT /user Update your password, name, and other attributes.

Documentation For Models

Documentation For Authorization

apiKey

  • Type: API key
  • API key parameter name: api-key
  • Location: HTTP header

apiNonce

  • Type: API key
  • API key parameter name: api-nonce
  • Location: HTTP header

apiSignature

  • Type: API key
  • API key parameter name: api-signature
  • Location: HTTP header

Author

support@bitmex.com

About


Languages

Language:PHP 99.9%Language:Shell 0.1%