{"id":33918927,"url":"https://github.com/ramonrsv/f1_data","last_synced_at":"2026-04-07T06:31:51.434Z","repository":{"id":321687056,"uuid":"628070724","full_name":"ramonrsv/f1_data","owner":"ramonrsv","description":"Provides consolidated access to various sources of Formula 1 information and data, including event schedules, session results, timing and telemetry data, as well as historical information about drivers, constructors, circuits, etc.","archived":false,"fork":false,"pushed_at":"2026-01-10T05:28:03.000Z","size":881,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-10T23:20:37.508Z","etag":null,"topics":["data","f1","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ramonrsv.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-04-14T21:01:30.000Z","updated_at":"2026-01-10T05:28:06.000Z","dependencies_parsed_at":"2025-11-08T01:03:57.927Z","dependency_job_id":null,"html_url":"https://github.com/ramonrsv/f1_data","commit_stats":null,"previous_names":["ramonrsv/f1_data"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ramonrsv/f1_data","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramonrsv%2Ff1_data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramonrsv%2Ff1_data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramonrsv%2Ff1_data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramonrsv%2Ff1_data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ramonrsv","download_url":"https://codeload.github.com/ramonrsv/f1_data/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramonrsv%2Ff1_data/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31503381,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data","f1","rust"],"created_at":"2025-12-12T08:37:32.763Z","updated_at":"2026-04-07T06:31:51.422Z","avatar_url":"https://github.com/ramonrsv.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# f1_data\n\n[![Build status](https://github.com/ramonrsv/f1_data/actions/workflows/ci.yml/badge.svg)](https://github.com/ramonrsv/f1_data/actions)\n[![Crates.io](https://img.shields.io/crates/v/f1_data.svg)](https://crates.io/crates/f1_data)\n[![Documentation](https://docs.rs/f1_data/badge.svg)](https://docs.rs/f1_data)\n[![codecov](https://codecov.io/github/ramonrsv/f1_data/graph/badge.svg?token=LYPNED8OXF)](https://codecov.io/github/ramonrsv/f1_data)\n\n`f1_data` is a Rust library that provides consolidated access to various sources of Formula 1\ninformation and data, including event schedules, session results, timing and telemetry data, as well\nas historical information about drivers, constructors, circuits, etc.\n\nIt aims to simplify the process of fetching and processing F1 data for applications by providing\nRust wrappers over different data sources and APIs, and a unified interface that consolidates this\ndata and abstracts away the different underlying sources.\n\n## Usage\n\nAdd `f1_data` as a dependency in your `Cargo.toml`:\n\n```toml\n[dependencies]\nf1_data = \"0.0.2\"\n```\n\nThen, in your Rust code:\n\n```rust\nuse f1_data::jolpica::{Agent, Filters};\n\nlet jolpica = Agent::default();\n\nlet michael_wins = jolpica.get_race_results(\n    Filters::new()\n        .driver_id(\"michael_schumacher\".into())\n        .finish_pos(1)\n    ).unwrap();\n\nassert_eq!(michael_wins.len(), 91);\n```\n\n## jolpica-f1\n\n[Jolpica F1](https://github.com/jolpica/jolpica-f1) is an open source API for querying Formula 1\ndata, with backwards compatible endpoints for the now deprecated Ergast API.\n\nThe `jolpica` module is a wrapper around this API, with additional functionality such as rate\nlimiting to comply with the [Terms of Use](https://github.com/jolpica/jolpica-f1/blob/main/TERMS.md)\n, automatic handling of multi-page responses, handling HTTP errors and retries, configurable\nalternate servers, etc. A synopsis of the wrapper interface and functionality is provided below.\n\nThe main entry point is the `Agent` struct, which provides methods for querying various\n[jolpica-f1 API endpoints](https://github.com/jolpica/jolpica-f1/blob/main/docs/README.md#endpoints-and-documentation),\nsuch as `get_drivers()`, `get_race_results()`, etc. Most methods accept an optional `Filters`\nparameter to filter the results, which correspond to the jolpica-f1 API's route parameters, e.g. for\n[race results](https://github.com/jolpica/jolpica-f1/blob/main/docs/endpoints/results.md#route-parameters).\n\n```rust\nlet race = jolpica.get_race_result(\n        Filters::new().season(2021).round(22).finish_pos(1)\n    ).unwrap();\n\nassert_eq!(race.race_result().driver.full_name(), \"Max Verstappen\");\n```\n\nThe `AgentConfigs` struct allows configuring various aspects of the `Agent`, such as the base URL of\nthe jolpica-f1 server, rate limiting options, multi-page response handling, etc.\n`AgentConfigs::default()` provides sensible defaults that respect the API's Terms of Use and should\nwork for most use cases.\n\n```rust\nlet jolpica = Agent::default();\n\n// The above is equivalent to:\nlet jolpica = Agent::new(AgentConfigs {\n    base_url: \"https://api.jolpi.ca/ergast/f1/\".into(),\n    multi_page: MultiPageOption::Enabled(None),\n    http_retries: Some(2),\n    rate_limiter: RateLimiterOption::Internal(RateLimiter::new(\n        Quota::per_hour(nonzero!(500u32)).allow_burst(nonzero!(4u32)),\n    )),\n});\n```\n\nThe `get_*` methods of the `Agent` are provided for convenience. They do different levels of\npost-processing and validation, and return different types. For example, `get_driver()` returns a\n`Driver` with information about a single driver, parsed from the API's JSON response. However, all\nof these methods build on top of the core lower-level `get_response()`, which accepts a `Resource`\nrepresenting the API endpoint to query, a `Filters` with none or any number of filters applied, and\nreturns a `Response` struct containing the full API response.\n\n```rust\nlet response = jolpica.get_response(\n    \u0026Resource::DriverInfo(\n        Filters::new().driver_id(\"leclerc\".into()))\n    ).unwrap();\n\nlet Table::Drivers { drivers } = response.table else {\n    panic!(\"expected drivers table\");\n};\n\nlet charles = \u0026drivers[0];\nassert_eq!(charles.full_name(), \"Charles Leclerc\");\n```\n\nNote that if `AgentConfigs::multi_page` is set to `MultiPageOption::Enabled` - the default in\n`AgentConfigs::default()`, then `get_response()`, and by extension many of the `get_*` methods, may\nmake multiple GET requests to fetch all pages of a multi-page response, transparently concatenating\nthe results into a single `Response`.\n\n```rust\n// Makes 9+ requests to fetch all pages\nlet all_drivers = jolpica.get_drivers().unwrap();\nassert!(all_drivers.len() \u003e= 864);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framonrsv%2Ff1_data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Framonrsv%2Ff1_data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framonrsv%2Ff1_data/lists"}