Skip to content

Commit 54890de

Browse files
committed
Added examples and detailed documentation
1 parent a9df9aa commit 54890de

1 file changed

Lines changed: 86 additions & 3 deletions

File tree

README.md

Lines changed: 86 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,36 +13,119 @@ Users can access the list of routes mentioned below to get JSON data.
1313
+ **HOME ROUTE :**
1414
This route is the home route of the API. This route can be accessed by `https://nobelapi.herokuapp.com/`
1515

16+
**_example :_**
17+
![SS](Image link "HomePage")
18+
1619
+ **NAME :**
1720
This route gives the Nobel laureates data based on their name.
1821
To access this route,
1922
`https://nobelapi.herokuapp.com/name/{name_of_laureate}`
2023

24+
**_example :_**
25+
26+
**Req :** `https://nobelapi.herokuapp.com/name/rogerpenrose`
27+
28+
**Res :**
29+
```
30+
{
31+
"id": "988",
32+
"firstname": "Roger",
33+
"surname": "Penrose",
34+
"born": "1931-08-08",
35+
"died": "0000-00-00",
36+
"bornCountry": "United Kingdom",
37+
"bornCountryCode": "GB",
38+
"bornCity": "Colchester",
39+
"gender": "male",
40+
"prizes": [
41+
{
42+
"year": "2020",
43+
"category": "physics",
44+
"share": "2",
45+
"motivation": "\"for the discovery that black hole formation is a robust prediction of the general theory of relativity\"",
46+
"affiliations": [
47+
{
48+
"name": "University of Oxford",
49+
"city": "Oxford",
50+
"country": "United Kingdom"
51+
}
52+
]
53+
}
54+
]
55+
}
56+
```
2157
+ **BORNAT :**
2258
This route gives a list of laureates for the given born country code.This route can be accessed by `https://nobelapi.herokuapp.com/bornat/{Country_Code}`
2359

60+
**_example :_**
61+
62+
**Req :** `https://nobleapi.herokuapp.com/bornat/IN`
63+
64+
**Res :**
65+
Use the below url to get a view of response.
66+
67+
[https://gist.github.com/code-reaper08/4645b73ef92a6f029ab4aa6225742612](https://gist.github.com/code-reaper08/4645b73ef92a6f029ab4aa6225742612)
68+
69+
2470
+ **DIEDAT :**
2571
This route gives a list of laureates for the given died country code.This route can be accessed using `https://nobelapi.herokuapp.com/diedat/{Country_Code}`
2672

73+
**_example :_**
74+
75+
**Req :** `https://nobleapi.herokuapp.com/diedat/IN`
76+
77+
**Res :**
78+
Use the below url to get a view of response.
79+
80+
[https://gist.github.com/code-reaper08/fcdceeb9d809dc3cf0c829b9350b88ed](https://gist.github.com/code-reaper08/fcdceeb9d809dc3cf0c829b9350b88ed)
81+
82+
2783
+ **GENDER :**
2884
This gives a list of laureates for a given gender.This can be accessed using `https://nobelapi.herokuapp.com/gender/{GENDER}`. The parameter {GENDER} should be a `male` or `female` in Lowercase.
2985

86+
**_example :_**
87+
88+
**Req :** `https://nobleapi.herokuapp.com/gender/female`
89+
90+
**Res :**
91+
Use the below url to get a view of response.
92+
93+
[https://gist.github.com/code-reaper08/31235c8af64c55edc38a193593c8bb42](https://gist.github.com/code-reaper08/31235c8af64c55edc38a193593c8bb42)
94+
3095
+ **GENDER AND BORN COUNTRY :**
3196
This gives a list of laureates for a given gender born at given country. This can be accessed using `https://nobelapi.herokuapp.com/{GENDER}/{Country_Code}`. Here `{Country_Code}`denotes the **born country**.
3297

98+
**_example :_**
99+
100+
**Req :** `https://nobleapi.herokuapp.com/gender/female/PL`
101+
102+
**Res :**
103+
Use the below url to get a view of response.
104+
105+
[https://gist.github.com/code-reaper08/29d55cc2668021e57f3e8cb0059710a9](https://gist.github.com/code-reaper08/29d55cc2668021e57f3e8cb0059710a9)
106+
33107
+ **BORNAT AND DIEDAT :**
34108
This gives a a list of laureates based on their born country and died country. One can combine parameters to get desired results using this route. This route can be accessed by `https://nobelapi.herokuapp.com/bornat/{Country_Code_1}/diedat/{Country_code_2}`. Here `Country_Code_1` denotes **born country** and `Country_Code_2` denotes **died country**.
35109

110+
**_example :_**
111+
112+
**Req :** `https://nobleapi.herokuapp.com/bornat/IN/diedat/IN`
113+
114+
**Res :**
115+
Use the below url to get a view of response.
116+
117+
[https://gist.github.com/code-reaper08/fef2c2bae52e5d96dbbc1b208b381304](https://gist.github.com/code-reaper08/fef2c2bae52e5d96dbbc1b208b381304)
118+
36119
## Something's not right ?
37120
Please open an issue, I'll be happy to look into it.
38121

39122
## Need some more ?
40123
Please open an issue again, clearly stating, what feautre you would like to add. We'll make it better.
41124

42125
## License:
43-
```
44-
MIT License
45126

46-
Copyright (c) 2021 Vishwa.R
127+
```
128+
MIT License
47129
130+
Copyright (c) 2021 Vishwa.R
48131
```

0 commit comments

Comments
 (0)