An open API service indexing awesome lists of open source software.

https://github.com/basemax/api-sarrafchi

Sarrafchi: API and web service to get live currency rates in Free Market.
https://github.com/basemax/api-sarrafchi

api currency-api currency-conversion currency-exchange-rates currency-rates sarrafchi

Last synced: 5 months ago
JSON representation

Sarrafchi: API and web service to get live currency rates in Free Market.

Awesome Lists containing this project

README

          

# API Sarrafchi

Sarrafchi: API and web service to get live currency rates in Free Market.

Watch demo at: https://basemax.github.io/API-Sarrafchi/example.html

## Sarrafchi API

**JSON Format:** API, Web-Service: https://api.sarrafchi.ir/rate/

#### Demo in other sites

[![Sarrafchi API](demo.jpg)](https://basemax.github.io/API-Sarrafchi/example.html)

### Example

```
.price-box{font-size: 13px;font-weight: 500;padding: 7px;margin-bottom: 5px;text-align: center;background: #dbd2fd;border-bottom: 1px solid #9d8eca;display: block;color: #48357f;border-radius: 50px;}




US Dollar: تومان


Euro: تومان


British Pound: تومان




Swiss Franc: تومان


Canadian Dollar: تومان


Australian Dollar: تومان




Swedish Krona: تومان


Norwegian Krone: تومان


Russian Ruble: تومان


var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if(this.readyState == 4 && this.status == 200) {
let obj = JSON.parse(this.responseText);
document.querySelector("#price_usd").innerHTML=obj.currencies["US Dollar"].sell;
document.querySelector("#price_euro").innerHTML=obj.currencies["Euro"].sell;
document.querySelector("#price_pound").innerHTML=obj.currencies["British Pound"].sell;
document.querySelector("#price_franc").innerHTML=obj.currencies["Swiss Franc"].sell;
document.querySelector("#price_canad").innerHTML=obj.currencies["Canadian Dollar"].sell;
document.querySelector("#price_austr").innerHTML=obj.currencies["Australian Dollar"].sell;
document.querySelector("#price_krona").innerHTML=obj.currencies["Swedish Krona"].sell;
document.querySelector("#price_norwkrona").innerHTML=obj.currencies["Norwegian Krone"].sell;
document.querySelector("#price_ruble").innerHTML=obj.currencies["Russian Ruble"].sell;
}
};
xhttp.open("GET", "https://api.sarrafchi.ir/rate/", true);
xhttp.send();

```

### Crontab

##### $ crontab -l

```
*/5 * * * * php /path/to/dir/update.php
```

---------

# Max Base

My nickname is Max, Programming language developer, Full-stack programmer. I love computer scientists, researchers, and compilers. ([Max Base](https://maxbase.org/))

## Asrez Team

A team includes some programmer, developer, designer, researcher(s) especially Max Base.

[Asrez Team](https://www.asrez.com/)