Skip to content

fcsapi/Forex-API-PHP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Forex Latest Prices API - PHP

V3 Update: 2021-02-12

FCS forex exchange quotes API is a PHP Library for fetching forex quotes, provide response in JSON format

Requirements

Installation

Download zip OR api directory from github and place it in your project, and in your php file.

<?php use FCS\FCS_forex; require_once(__DIR__.'/api/FCS_forex.php'); // Include library

Instantiate the client

<?php // You can get your API key from fcsapi.com define('FCS_KEY','API_KEY'); $forex = new FCS_forex(); // class object

API Output

Default output is array in php, valid values are: array, json, jsonp, object, xml, serialize

$forex->set_output_type('JSON');

Get the list of available symbols:

$response = $forex->get_symbols_list();

Get quotes for specific currency:

$response = $forex->get_latest_price([ 'EUR/USD', 'USD/JPY', 'GBP/AUD' ]); // OR without array $response = $forex->get_latest_price('EUR/USD,GBP/AUD'); // OR by ids $response = $forex->get_latest_price('1,2,3,4');

Convert one currency into another:

Convert 200 EUR : output = 240USD

$response = $forex->get_converter(200, 'EUR','USD');

Other API methods

You can check full documentaions here https://fcsapi.com/document/forex-api

<?php $response = $forex->get_symbols_list(); $response = $forex->get_profile('EUR,USD,JPY'); $response = $forex->get_converter(200, 'EUR','USD'); // 200EUR to output 240 USD $response = $forex->get_base_prices('EUR'); $response = $forex->get_base_prices('EUR','crypto'); $response = $forex->get_latest_price('all_forex'); $response = $forex->get_latest_price('1,2'); // by id, Latest OHLC $response = $forex->get_latest_price( ['EUR/USD','JPY/USD'] ); // OHLC, Ask,bid,spread, change  $response = $forex->get_last_candle('all_forex','5m'); $response = $forex->get_last_candle('all_forex','1h'); $response = $forex->get_last_candle('all_forex','1d'); $response = $forex->get_last_candle('1,2,3,4,5','1d'); // OHLC of specific time period $response = $forex->get_pivot_points('1','1d'); // Support / Resistance $response = $forex->get_pivot_points('EUR/USD','4h'); $response = $forex->get_moving_averages('1','1d'); // MA Lines signals $response = $forex->get_moving_averages('EUR/USD','1d'); $response = $forex->get_technical_indicator('1','1d'); // Top Indicators $response = $forex->get_technical_indicator('EUR/USD','1d'); $response = $forex->get_economy_calendar('USD,JPY'); $response = $forex->get_economy_calendar('USD','2021-02-01','2021-02-10'); $response = $forex->get_search_query('BTC Dollar',0); // contain any words $response = $forex->get_search_query('BTC Dollar',1); // contain all words $params = array('id'=>1,'period'=>'1h','limit'=>2); $response = $forex->get_history($params);

Support and Contact

you can contact us at support@fcsapi.com or Live chat at https://fcsapi.com

License and Terms

This library is provided under the MIT license, also FCS terms and conditons apply.

About

FCSAPI provide Forex latest and historical data, pivot points, indicator data and economic calendar.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages