Live Link : https://hostingapi.onrender.com/docs
This project provides an API for retrieving and searching trades. The API is built using Python and FastAPI.
- Clone the project repository from Github:
git clone git@github.com:lakshya7878/Lakshya-Sharma_Backend.git
- Install the required Python packages using pip:
pip install -r requirements.txt
- Start the API server:
uvicorn main:app --reload
The Trade API provides the following endpoints:
Implemented pagination of list of data while displaying Trades.
GET /trades?page=1&size=50
Implemented sorting of list of data by price
GET /sortby/price
GET /trades
Returns a list of all trades.
GET /trades/{id}
Returns a single trade by ID.
GET /trades?search={query}
Returns a list of trades that match the search query. The search query can be any text that exists in the fields listed in the overview above.
GET /trades?assetClass={asset_class}&end={end}&maxPrice={max_price}&minPrice={min_price}&start={start}&tradeType={trade_type}
Returns a list of trades that match the specified filters. The filters are optional, and can be combined to narrow down the search results.
The API documentation can be accessed at https://hostingapi.onrender.com/docs or http://localhost:8000/docs or http://localhost:8000/redoc after starting the server.
Contributions to this project are welcome. Please create a pull request with your changes and ensure that all tests pass before submitting.
This project is licensed under the MIT License. See the LICENSE file for more information.