I only do fantasy football, so it might be different for another sport, but in FF, just go to the "Settings" page for your league. It is the first item in the list. Put that number at the end of the "key" (for current FF it would be):
242.l.LeagueId
Hope that helps,
C
Yup, definitely agreed with Christian if you're trying to figure out the league ID for your own league, ie, if you're just building an application to grab your own data. If you're trying to actually build an application for random people on the internet to use, you'd want to use the user-based webservice requests that I mentioned in my first reply, which would return back the league key as part of the response. Example:
CODE
http://fantasysports.yahooapis.com/fantasy/v2/users;use_login=1/games;game_keys=nfl/leagues
Will give you all the NFL leagues that the logged-in user is playing in.