{"id":50769791,"url":"https://github.com/sgerrand/ex_fpl","last_synced_at":"2026-06-11T17:01:47.546Z","repository":{"id":356974841,"uuid":"1234777950","full_name":"sgerrand/ex_fpl","owner":"sgerrand","description":"Elixir client for the unofficial Fantasy Premier League API","archived":false,"fork":false,"pushed_at":"2026-05-10T19:49:40.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-29T09:35:45.349Z","etag":null,"topics":["api-client","elixir-library","fantasy-premier-league","fpl-api","hex-package"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/ex_fpl","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sgerrand.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2026-05-10T16:22:03.000Z","updated_at":"2026-05-10T19:49:45.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sgerrand/ex_fpl","commit_stats":null,"previous_names":["sgerrand/ex_fpl"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sgerrand/ex_fpl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgerrand%2Fex_fpl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgerrand%2Fex_fpl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgerrand%2Fex_fpl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgerrand%2Fex_fpl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sgerrand","download_url":"https://codeload.github.com/sgerrand/ex_fpl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgerrand%2Fex_fpl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34208761,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["api-client","elixir-library","fantasy-premier-league","fpl-api","hex-package"],"created_at":"2026-06-11T17:01:46.554Z","updated_at":"2026-06-11T17:01:47.534Z","avatar_url":"https://github.com/sgerrand.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ExFPL\n\nElixir client for the unofficial [Fantasy Premier\nLeague](https://fantasy.premierleague.com/) public REST API.\n\n## Installation\n\nAdd `:ex_fpl` to your dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:ex_fpl, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\n## Quick start\n\n```elixir\n# Bootstrap snapshot — players, teams, gameweeks. Cached in ETS for 1 hour.\n{:ok, snapshot} = ExFPL.Bootstrap.fetch()\n%ExFPL.Snapshot{teams: teams, players: players, events: events} = snapshot\n\n# All fixtures, or just one gameweek's\n{:ok, fixtures} = ExFPL.Fixtures.list()\n{:ok, gw1}      = ExFPL.Fixtures.list(event: 1)\n\n# Live gameweek data\n{:ok, %ExFPL.LiveSnapshot{}} = ExFPL.Live.fetch(1)\n\n# Per-player history and upcoming\n{:ok, %ExFPL.PlayerSummary{}} = ExFPL.Players.summary(player_id)\n\n# Manager / entry data\n{:ok, %ExFPL.Entry{}}        = ExFPL.Entries.get(team_id)\n{:ok, %ExFPL.EntryHistory{}} = ExFPL.Entries.history(team_id)\n{:ok, %ExFPL.Picks{}}        = ExFPL.Entries.picks(team_id, gameweek)\n\n# Classic and H2H league standings\n{:ok, %ExFPL.ClassicStandings{}} = ExFPL.Leagues.Classic.standings(314)\n{:ok, %ExFPL.ClassicStandings{}} = ExFPL.Leagues.Classic.standings(314, page: 2)\n\n{:ok, %ExFPL.H2HStandings{}}     = ExFPL.Leagues.H2H.standings(999)\n{:ok, h2h_matches}             = ExFPL.Leagues.H2H.matches(999, event: 5)\n```\n\n## Resource modules\n\n| Module | Endpoint | Returns |\n|---|---|---|\n| `ExFPL.Bootstrap` | `/bootstrap-static/` | `ExFPL.Snapshot` |\n| `ExFPL.Fixtures` | `/fixtures/` | `[ExFPL.Fixture]` |\n| `ExFPL.Live` | `/event/{id}/live/` | `ExFPL.LiveSnapshot` |\n| `ExFPL.Players` | `/element-summary/{id}/` | `ExFPL.PlayerSummary` |\n| `ExFPL.Entries` | `/entry/{id}/`, `/history/`, `/picks/`, `/me/`, `/my-team/{id}/` | `ExFPL.Entry`, `ExFPL.EntryHistory`, `ExFPL.Picks`, `ExFPL.Me`, `ExFPL.MyTeam` |\n| `ExFPL.Leagues.Classic` | `/leagues-classic/{id}/standings/` | `ExFPL.ClassicStandings` |\n| `ExFPL.Leagues.H2H` | `/leagues-h2h/{id}/standings/`, `/leagues-h2h-matches/league/{id}/` | `ExFPL.H2HStandings`, `[ExFPL.H2HMatch]` |\n\nEvery fetch function accepts:\n\n- `raw: true` — return the raw JSON-decoded map (string keys preserved) instead\n  of the struct, useful when you need fields not modelled on the struct.\n- Any other key is forwarded to `Req` (e.g. `retry: false`, `receive_timeout:\n  30_000`).\n\n## Caching\n\n`ExFPL.Bootstrap.fetch/1` caches its (~1 MB) response in an application-supervised\nETS table for one hour. Pass `cache: false` to bypass the cache; call\n`ExFPL.Cache.invalidate/0` to clear it.\n\n```elixir\nExFPL.Bootstrap.fetch()                # cache hit on second call\nExFPL.Bootstrap.fetch(cache: false)    # always fetches\nExFPL.Cache.invalidate()               # clear the cache\n```\n\n## Authenticated endpoints\n\n`/me/` and `/my-team/{team_id}/` require a session cookie obtained from a\nlogged-in browser. This library does not implement the login flow itself —\nconstruct an `ExFPL.Session` from the cookie value:\n\n```elixir\nsession = ExFPL.Session.new(cookie: \"pl_profile=...; sessionid=...\")\n{:ok, %ExFPL.Me{}}     = ExFPL.Entries.me(session: session)\n{:ok, %ExFPL.MyTeam{}} = ExFPL.Entries.my_team(team_id, session: session)\n```\n\nCalling these without a session raises `ArgumentError`.\n\n## Telemetry\n\nEach HTTP request emits a `[:fpl, :http, :request]` telemetry event with\n`%{duration: native_time}` and `%{path: path, result: :ok | :error}`.\n\n```elixir\n:telemetry.attach(\"fpl-logger\", [:fpl, :http, :request], \u0026MyApp.handle/4, nil)\n```\n\n## Testing\n\nTests stub the network with [`Req.Test`](https://hexdocs.pm/req/Req.Test.html).\nConfigure your tests to use the stub plug:\n\n```elixir\n# test/test_helper.exs\nApplication.put_env(:ex_fpl, :req_options, plug: {Req.Test, ExFPL.HTTPStub})\nExUnit.start()\n```\n\nThen in any test:\n\n```elixir\nReq.Test.stub(ExFPL.HTTPStub, fn conn -\u003e\n  Req.Test.json(conn, %{\"teams\" =\u003e [...], \"elements\" =\u003e [...]})\nend)\n\n{:ok, %ExFPL.Snapshot{}} = ExFPL.Bootstrap.fetch(cache: false)\n```\n\n## Contributing\n\nRun `mix check` locally before opening a pull request. This alias runs the same\nchecks the git hooks enforce:\n\n- `mix format --check-formatted`\n- `mix compile --warnings-as-errors`\n- `mix credo --strict`\n- `mix deps.unlock --check-unused`\n\nHooks are managed by [`git_hooks`](https://hex.pm/packages/git_hooks) and\nauto-install on `mix deps.get`. Pre-commit runs the four checks above; pre-push\nruns `mix test`.\n\n## Documentation\n\nDocumentation is generated with [ExDoc](https://github.com/elixir-lang/ex_doc)\nand published on [HexDocs](https://hexdocs.pm/ex_fpl).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgerrand%2Fex_fpl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsgerrand%2Fex_fpl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgerrand%2Fex_fpl/lists"}