Skip to content

Latest commit

 

History

History
98 lines (66 loc) · 1.75 KB

File metadata and controls

98 lines (66 loc) · 1.75 KB

Rashifal API in Flask

This is a very simple API that get the data about rashifal for the day, for the week, for the month and for the year. The data for the week cannot be accessed right now but I will soon add that feature

Base URL

"https://python.ankurgajurel.com.np/rashifal"

Authentication

At the moment, I have not implemented authentication to this API.

Endpoints

'GET /'

Retrieves the Home Page

Parameters

No parameters.

Example request:

import requests
base_url = "https://python.ankurgajurel.com.np/rashifal"
response = requests.get(base_url).text
print(response)

'GET /daily[rashi]'

Parameters

  • "rashi": The rashi you want to get the data for

Example request:

import requests
base_url = "https://python.ankurgajurel.com.np/rashifal"
work_url = base_url + "/daily"
rashi = "singha"
response = requests.get(work_url + "/" + rashi).text
print(response)

'GET /monthly/[rashi]'

Parameters

  • "rashi": The rashi you want to get the data for

Example request:

import requests
base_url = "https://python.ankurgajurel.com.np/rashifal"
work_url = base_url + "/monthly"
rashi = "singha"
response = requests.get(work_url + "/" + rashi).text
print(response)

'GET /yearly/[rashi]'

Parameters

  • "rashi": The rashi you want to get the data for

Example request:

import requests
base_url = "https://python.ankurgajurel.com.np/rashifal"
work_url = base_url + "/yearly"
rashi = "singha"
response = requests.get(work_url + "/" + rashi).text
print(response)

TESTS

To test the endpoints of the API, run the following commands

cd ./tests
python3 test_api.py

And, check the following URL on the browser.

http://127.0.0.1:9881