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.
- Host: GitHub
- URL: https://github.com/basemax/api-sarrafchi
- Owner: BaseMax
- License: mit
- Created: 2020-08-28T11:43:20.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2024-09-05T00:00:20.000Z (almost 2 years ago)
- Last Synced: 2025-10-25T11:57:23.946Z (8 months ago)
- Topics: api, currency-api, currency-conversion, currency-exchange-rates, currency-rates, sarrafchi
- Language: PHP
- Homepage: https://basemax.github.io/API-Sarrafchi/example.html
- Size: 1.05 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
[](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/)