Lyo.Espn.Fantasy.Football.Client 3.0.0

dotnet add package Lyo.Espn.Fantasy.Football.Client --version 3.0.0
                    
NuGet\Install-Package Lyo.Espn.Fantasy.Football.Client -Version 3.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Lyo.Espn.Fantasy.Football.Client" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Lyo.Espn.Fantasy.Football.Client" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Lyo.Espn.Fantasy.Football.Client" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Lyo.Espn.Fantasy.Football.Client --version 3.0.0
                    
#r "nuget: Lyo.Espn.Fantasy.Football.Client, 3.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Lyo.Espn.Fantasy.Football.Client@3.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Lyo.Espn.Fantasy.Football.Client&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Lyo.Espn.Fantasy.Football.Client&version=3.0.0
                    
Install as a Cake Tool

Lyo.Espn.Fantasy.Football.Client

Typed client for ESPN fantasy football. League reads use lm-api-reads, transaction writes use lm-api-writes, Fantasy Chat uses lm-api-communication, and player news uses site.api.espn.com. It subclasses LyoHttpClient and sends a browser User-Agent on every request so the chat host does not return 403.

Examples

Wire into DI (Extensions.cs)

services.AddFantasyFootballClientFromConfiguration(builder.Configuration);

// or:
services.AddFantasyFootballClient(o => {
    o.EspnS2 = "...";
    o.Swid = "{...}";
});

Manager surface

FantasyFootballClient exposes four manager properties; seasons before 2018 are rejected (checked by ValidateSeason).

Property Manager Calls
League LeagueManager GetAsync(leagueId, seasonId) (settings + teams + standings; also fills the in-memory league index), GetTeamsAsync (rosters for each scoring period), GetTeamAsync (one team), GetDraftAsync (draft picks), GetMatchupsAsync (scoreboard), GetBoxScoreAsync (one matchup with a typed roster).
Players PlayerManager GetInfoAsync(leagueId, seasonId, query) (player cards through kona_playercard; writes the player cache), GetPlayerAsync (one player), GetAsync(leagueId, seasonId, playerIds) (cached cards, fetching only the misses), GetFreeAgentsAsync (kona_player_info for FREEAGENT and WAIVERS), GetNewsAsync (fantasy news feed).
Communication CommunicationManager GetLeagueChatAsync (lists Fantasy Chat topics on lm-api-communication, then loads each conversation; pass a LeagueRes or a league id and season), GetConversationAsync (one topic; newest 25 messages by default; same league overload), LoadPlayersAsync (one player-card request for a conversation you already loaded), GetRecentActivityAsync (adds/drops/trades feed through kona_league_communication), PostMessageAsync (user text, messageTypeId 0). ChatMessageBuilder.For(ChatTopics.AllMembers) posts to the league chat. ChatMessageBuilder.To(member) posts to that member's direct message. The post response is a one-element array; the method returns that message.
Transactions TransactionsManager GetRecentAsync (mTransactions2 view, optional type filter), GetRecentTradesAsync (TRADE_* shorthand), GetPendingAsync (mPendingTransactions), PostTransactionAsync, SetLineupAsync, AddDropAsync, CancelWaiverAsync, ProposeTradeAsync, RespondToTradeAsync. Lineup moves accept LineupSlot (Bench is 20, Quarterback is 0).

FantasyFilterReqBuilder builds x-fantasy-filter JSON. Write bodies come from LineupTransactionBuilder, RosterTransactionBuilder, TradeTransactionBuilder, and ChatMessageBuilder. The manager methods post Build(); they do not assemble the ESPN JSON themselves.

Remember (also called from League.GetAsync) replaces LeagueIndex: members by SWID, teams by id and primary owner. FindMember and FindTeam match one display name, team name, abbreviation, or "Location Nickname". Author LM is the league manager. PlayerCache stores cards by season and player id. ToItemViewsAsync returns a structured copy of a transaction and does not change that ESPN record.

ChatMessageRes is the chat message a conversation returns. Raw ids and unix times keep a suffix: AuthorId, DateUnix, DateEditedUnix, ViewableByIds, TeamId, and PlayerId. The unsuffixed name is the friendly value: Author and Members are league members, Date and DateEdited are timestamps, Team is the league team, and Player is the card. Kind is Text, AddDrop, Trade, or Unknown. A trade (ESPN type 271, or keys such as team1addP* / team2addP* / team1dropP* / team2dropP* / tId) has Side1, Side2, a transaction id, and every numbered player in numeric order. An add/drop (ESPN type 266, or addP* / dropP*) keeps every pickup and drop on side 1. Types 0 and 270 are text. GetLeagueChatAsync and GetConversationAsync accept a league or a league id and season. They bind the ESPN JSON with the normal serializer and copy it onto these models. Author, Members, and Team are filled from the league index when it already has them. Loading the league later does not change a chat object you already have. They do not fetch cards. Communication.LoadPlayersAsync fills Player with one request. Author stays null for LM.

ChatTopics holds AllMembers and DirectMessage. ChatMessageBuilder.For takes one of those. ChatMessageBuilder.To takes a member, a SWID, or a unique display name and posts to the existing direct message.

Request types sit under Models/Request (PlayerInfoQuery, ChatConversationQuery, RecentActivityQuery, TransactionsQuery, FantasyFilterReq, FantasyTransactionReq, ChatMessageReq). Response types sit under Models/Response (LeagueRes, TeamRes, MatchupRes, MatchupRosterRes, PlayerInfoItemRes, PlayerNewsFeedRes, TransactionRes, ChatConversationRes, ChatMessageRes). ChatConversationRes is that topic, with the same id-and-model pairs.

Settings (FantasyFootballClientOptions)

Binds from section FantasyFootballClient. Picks up the LyoHttpClientOptions flags and adds:

Property Description
EspnS2 Optional espn_s2 cookie value. Needed for private leagues.
Swid Optional SWID cookie value. Needed for private leagues.
CommunicationBaseUrl Fantasy Chat host root. Defaults to https://lm-api-communication.fantasy.espn.com/apis/v3/games/ffl/.
WritesBaseUrl Lineup, waiver, and trade host root. Defaults to https://lm-api-writes.fantasy.espn.com/apis/v3/games/ffl/.
NewsBaseUrl Fantasy player news URL. Defaults to https://site.api.espn.com/apis/fantasy/v3/games/ffl/news/players.
UserAgent.Enabled On by default. Sends the Chrome agent from LyoHttpUserAgentOptions on every request. The chat host returns 403 without it.

BaseUrl defaults to https://lm-api-reads.fantasy.espn.com/apis/v3/games/ffl/. CommunicationBaseUrl defaults to the Fantasy Chat host. WritesBaseUrl defaults to the writes host. NewsBaseUrl is the news feed URL. Public leagues skip cookies; both cookie values must be set before the client attaches them. Chat posts require Swid.

Wire into DI (Extensions.cs)

Method Description
AddFantasyFootballClientFromConfiguration(configuration, sectionName?) Reads FantasyFootballClientOptions from configuration (default section "FantasyFootballClient").
AddFantasyFootballClient(Action<FantasyFootballClientOptions> configure) Constructs options in place.
AddFantasyFootballClient(FantasyFootballClientOptions options) Takes a ready-made options object.

Every overload registers FantasyFootballClient as a singleton and takes ILoggerFactory plus any registered HttpClient from DI.

Dependencies

Generated from ProjectReference / PackageReference (same model as docs/Lyo.ProjectGraph.html).

  • Lyo.Http.Client (direct, lyo)
  • Lyo.Json (direct, lyo)
  • Lyo.Metrics (direct, lyo)
  • Microsoft.Extensions.DependencyInjection.Abstractions 10.0.5 (direct, microsoft)
  • Microsoft.Extensions.Http 10.0.5 (direct, microsoft)
  • Microsoft.Extensions.Logging.Abstractions 10.0.5 (direct, microsoft)
  • Lyo.Common.Core (transitive, lyo)
  • Lyo.Common.Metadata (transitive, lyo)
  • Lyo.DataTable.Models (transitive, lyo)
  • Lyo.Exceptions (transitive, lyo)
  • Lyo.RateLimit (transitive, lyo)
  • Lyo.Result (transitive, lyo)
  • AngleSharp 1.5.0 (transitive, third-party)
  • Microsoft.Bcl.AsyncInterfaces 10.0.5 (transitive, microsoft, netstandard2.0)
  • Microsoft.Bcl.TimeProvider 8.0.1 (transitive, microsoft, netstandard2.0)
  • Microsoft.Extensions.Configuration.Binder 10.0.5 (transitive, microsoft)
  • System.Memory 4.6.3 (transitive, microsoft, netstandard2.0)
  • System.Text.Encoding.CodePages 10.0.5 (transitive, microsoft)
  • System.Text.Json 10.0.5 (transitive, microsoft, netstandard2.0)
  • System.Threading.RateLimiting 10.0.5 (transitive, microsoft)
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Lyo.Espn.Fantasy.Football.Client:

Package Downloads
Lyo.FantasyFootball.Api

HTTP API for fantasy football chats and trades. Reads the plugin store and syncs through the ESPN client.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0 146 10/23/2026
2.0.1 131 9/14/2026
2.0.0 120 9/9/2026
1.0.13 129 8/25/2026
1.0.11 121 8/23/2026
1.0.9 131 8/22/2026
1.0.6 124 8/20/2026
1.0.4 134 8/20/2026
1.0.3 122 8/19/2026
1.0.2 124 8/19/2026
1.0.1 137 8/18/2026
1.0.0 133 8/16/2026