Skip to content

Simple Python API for fetching cryptocurrency exchange rate via Google

Notifications You must be signed in to change notification settings

nogiszd/py-crypto-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

py-crypto-api example workflow

Super simple Python API for fetching cryptocurrency exchange rate via Google Search.
Written with FastAPI and scraping via BeautifulSoup4.

Installation

Firstly you need to install dependencies pip install -r requirements.txt.
To host API you need to run it with uvicorn --reload main:app (the default port is 8000).
(the --reload switch is optional)

Testing and development was taken on Python 3.10.

Usage

URL Description Output
localhost:8000/v1/{query} Replace {query} with search phrase,
for e.g. "1 btc to usd"
Outputs JSON formatted response e.g. {"amount":"9.9"}
where 9.9 is amount of USD for 1 Bitcoin
localhost:8000/v2/?crypto={value}&currency={value} Replace {value} correspondingly to
query params
Outputs JSON formatted response e.g. {"amount":"9.9"}
where 9.9 is amount of provided currency for 1 coin of provided cryptocurrency

You can use Swagger UI to visualize everything via localhost:8000/docs

About

Simple Python API for fetching cryptocurrency exchange rate via Google

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages