Migrate to Netlify Today

Netlify announces the next evolution of Gatsby Cloud. Learn more

ContactSign Up
Community Plugin
View plugin on GitHub

Gatsby

Ergast API for Gatsby

Simple source plugin to grab the latest Formula 1 season data from the fantastic Ergast API.


🏎 Quick start

yarn add gatsby-source-ergast

or

npm i gatsby-source-ergast

Add this to your gatsby-config.js file 👍

plugins: [
  "gatsby-source-ergast",
],

Enjoy 🎉


🧐 What’s inside?

/gatsby-source-ergast
├── .gitignore
├── gatsby-node.js
├── index.js
├── LICENSE
├── package.json
└── README.md
  • .gitignore: Stuff not to track.
  • gatsby-node.js: The good stuff 👀.
  • index.js: A file that will be loaded by default when the plugin is required by another application.
  • LICENSE: This source plugin is licensed under the 0BSD license.
  • package.json: A manifest file, which includes things like metadata.
  • README.md: A text file containing useful reference information.

🙏 Contributing

Feel free to submit updates/PRs for this source plugin. It’s still very basic and could be expanded to include a lot more control over the data pulled from Ergast.


Notes:

Inline with the request from Ergast to keep calls to a minimum, Gatsby will call the API to reqest data at build-time. The slight downside being that you’ll need to manually build the site (or feel free to make a webhook) after a race meeting, to ensure the results/standings and times are all up to date.

If this is something i end up creating, i’ll update the plugin readme to reflect this.

© 2023 Gatsby, Inc.