Skip to content

Commit 457c80a

Browse files
author
1Forge
committed
Readme update
1 parent b263c2a commit 457c80a

File tree

1 file changed

+49
-7
lines changed

1 file changed

+49
-7
lines changed

README.md

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ ForexQuotes is a PHP Library for fetching realtime forex quotes
99
- [Usage](#usage)
1010
- [List of Symbols available](#get-the-list-of-available-symbols)
1111
- [Get quotes for specific symbols](#get-quotes-for-specified-symbols)
12+
- [Convert from one currency to another](#convert-from-one-currency-to-another)
1213
- [Other implementations](#other-implementations)
1314
- [API Call: Get all quotes](#get-all-quotes)
1415
- [API Call: Get specific quotes](#get-specific-quotes)
@@ -39,7 +40,9 @@ Or in your composer.json
3940

4041
use OneForge\ForexQuotes\ForexRequest;
4142

42-
//Returns an array of symbols, eg: ['EURUSD', 'GBPJPY']
43+
/*
44+
Returns an array of symbols, eg: ['EURUSD', 'GBPJPY']
45+
*/
4346
ForexRequest::getSymbols();
4447
```
4548
### Get quotes for specified symbols:
@@ -70,15 +73,36 @@ ForexRequest::getQuotes([
7073
```
7174

7275

76+
77+
78+
### Convert from one currency to another:
79+
```php
80+
<?php
81+
82+
use OneForge\ForexQuotes\ForexRequest;
83+
84+
/*
85+
86+
[value] => 111.961
87+
[text] => 100 EUR is worth 111.961 USD
88+
[timestamp] => 1497187505
89+
90+
*/
91+
ForexRequest::convert('USD', 'EUR', 100);
92+
```
93+
94+
95+
7396
### Check if the market is open:
7497
```php
7598
<?php
7699

77100
use OneForge\ForexQuotes\ForexRequest;
78101

79102
/*
80-
Returns an boolean
103+
Returns an boolean
81104
*/
105+
82106
if (ForexRequest::marketIsOpen())
83107
{
84108
echo "Market is open";
@@ -138,6 +162,24 @@ GET https://forex.1forge.com/1.0.1/symbols
138162
]
139163
```
140164

165+
166+
### Convert from one currency to another
167+
#### Request
168+
```
169+
GET https://forex.1forge.com/1.0.1/convert?from=USD&to=EUR&quantity=100
170+
```
171+
172+
#### Response
173+
```javascript
174+
175+
{
176+
value: 89.3164183,
177+
text: "100 USD is worth 89.3164183 EUR",
178+
timestamp: 1497186516
179+
}
180+
181+
```
182+
141183
### Get the market status
142184
#### Request
143185
```
@@ -146,11 +188,11 @@ GET https://forex.1forge.com/1.0.1/market_status
146188

147189
#### Response
148190
```javascript
149-
[
150-
{
151-
market_is_open: true
152-
}
153-
]
191+
192+
{
193+
market_is_open: true
194+
}
195+
154196
```
155197

156198
## Support and Contact

0 commit comments

Comments
 (0)