|
1 | 1 | # F1 API
|
2 |
| - |
| 2 | + |
3 | 3 | The scraper scrapes this given https://www.formula1.com/
|
4 | 4 |
|
5 |
| -## Functions added |
| 5 | +## Functions |
| 6 | + |
| 7 | +- **getConstructorStandings** |
| 8 | + |
| 9 | + Fetch Constructors standings from points table. |
| 10 | + The function takes one argument: The year from which you want to extract points table for. |
| 11 | + Default argument is the current year. |
| 12 | + |
| 13 | +- **getDriverStandings** |
| 14 | + Fetch F1 driver standings from points table. |
| 15 | + The function takes one argument: The year from which you want to extract points table for. |
| 16 | + Default argument is the current year. |
| 17 | + |
| 18 | +- **getDriverData** |
| 19 | + Fetch the current lineup of F1 drivers. |
| 20 | + _No arguments_ |
| 21 | + |
| 22 | +- **getTeamsData** |
| 23 | + Fetch the current list of F1 teams along with their information. |
| 24 | + _No arguments_ |
| 25 | + |
| 26 | +- **getWorldChampions** |
| 27 | + Fetch all the world champions |
| 28 | + _No arguments_ |
| 29 | + |
| 30 | +## Snapshots |
| 31 | + |
| 32 | +If you want to have a look at the output from the given functions check [this](https://github.com/yashkathe/F1-API/tree/master/__tests__/__snapshots__). |
| 33 | + |
| 34 | +## Example snippet |
| 35 | + |
| 36 | +Example on how to use one the given functions. |
| 37 | +The following function will print the current lineup of F1 drivers. |
| 38 | + |
| 39 | +```javascript |
| 40 | +const f1Api = require('f1-api') |
6 | 41 |
|
7 |
| -- getDriverData |
8 |
| - Fetch the current list of F1 drivers along with their information |
| 42 | +const myFunction = async () => { |
| 43 | + const driverLineup = await f1Api.getDriverData() |
| 44 | + console.log(driverLineup) |
| 45 | +} |
9 | 46 |
|
10 |
| -- getTeamsData |
11 |
| - Fetch the current list of F1 teams along with their information |
| 47 | +myFunction() |
| 48 | +``` |
12 | 49 |
|
13 |
| -- getDriverStandings |
14 |
| - Fetch F1 driver standings from points table |
| 50 | +## Usage |
| 51 | +WARNING: Abusing this library may result in an IP ban from the host website. |
| 52 | +Please use with caution and try to limit the rate and amount of your requests if you value your access to formula1.com |
15 | 53 |
|
16 |
| -- getConstructorStandings |
17 |
| - Fetch Constructors standings from points table |
| 54 | +## Report Problems |
18 | 55 |
|
19 |
| -- getWorldChampions |
20 |
| - Fetch all the world champions |
| 56 | +If you have any problems regarding this project, read the following [disclaimer](https://github.com/yashkathe/F1-API/blob/master/DISCLAIMER.md). |
0 commit comments