ReONE-SM1975 / nobel_prizes_SM1975

A web app to search nobel prizes winner - enhanced via django and reactJS
MIT License
1 stars 0 forks source link

create new api to handle payload #52

Open SirrorsMoore1975 opened 3 months ago

SirrorsMoore1975 commented 3 months ago

Title

Create new api to handle payload

Issues

Client + Server

Matter

There are far more than calling the official nobel prize API. By including some fixed query parameters, a more specific response of search of the nobel prize data can be returned.

For example:

Prize

In the case of : http://api.nobelprize.org/v1/prize.json , we have the following query parameters:- Query Params Descriptions
year (int32) Year of the Nobel Prize as YYYY format
yearTo (int32) End of year span as YYYT format. Year is required and used at start. (i.e.: ?year=YYYY&yearTo=YYYY )
category (string) Search for prize by category (physics, chemistry, medicine, peace, literature or economics)
numberOfLaureates (int32) Filter prizes by number of laureates who shared the prize

Laureates

Here is Laureate , where the api is : http://api.nobelprize.org/v1/laureate.json . For country code, see Country (below)

Query Params Descriptions
id (int32) ID of a unique Nobel Laureate
bornCountry (string) Search for laureates by country of birth
bornCountryCode (string) Search for laureates by country of birth based on country code
bornCity (string) Search for laureates by city of birth
diedCountry (string) Search for laureates by country where they died
diedCountryCode (string) Search for laureates by country where they died based on country code
diedCity (string) Search for laureates by city where they died
bornDate (string) Search for laureates by city where they died
bornDateTo (string) End of search for laureates by year (YYYY) or date (YYYYMMDD) of birth. Requires the bornDate param to be set
diedDate (string) Search for laureates by year (YYYY) or date (YYYYMMDD) of death
diedDateTo (string) End of search for laureates by year (YYYY) or date (YYYYMMDD) of death. Requires the diedDate param to be set
motivation (string) Search for laureates based on the motivation of receiving the prize
gender (string) Default to All Search for laureates by gender (All, Male, Female or Organization)
affiliation (string) Search for laureates by affiliation

Country

For country, the link is: http://api.nobelprize.org/v1/country.json . However, the official api reference page does not indicate any query parameters for country. It return an object with two keys, name and code. The code is a two letter long uppercase alphabet, the name is the name in string to what the code represent.

Task

The Task of this branch shall be:-

References

More details in:- Get Start with v1 Code Example Prize Laureate Country