|
First, review the questions below. And then if they don't help, you can submit a Support Ticket to us.Category: Advanced Customization# | Question |
1. | Why are my API calls sometimes not returning any data? Answer: If the same exact request sometimes works and sometimes doesn't return any data it could be that your request is being throttled. Starting in 2020 we are monitoring API usage and putting in some restrictions to deal with abuse that's affecting the performance of the site to all our users. While most of these bad actors are likely the result of not knowing any better, we have enough evidence that some API users are acting maliciously, with the intent to disrupt our operation or hack into the system to either extract user information or gain an undue advantage. This has forced us to put in additional measures into this system.
Request throttling will happen when a particular client (as defined by their IP address) makes more API requests in a period of time than we deemed necessary or reasonable. We are not going to publish the exact limits because they will change depending on the time of day, time of year, current traffic to the site and other factors. We will also be adjusting this number as we learn more about how it's being used. When a client exceeds this limit, the client will be marked as 'abusive' and for a period of time, a percent of their requests will be denied. You may identify these calls with HTTP status code of 429: TOO MANY REQUESTS. These calls will return no content and will only be identified by the HTTP status code. The period of time that a client will be in this state will depend on the level of abuse. The worse the abuse was, the longer it will stay in place. In addition, the percent of calls that will be throttled will increase if the client continues to abuse the system. The absolute worst thing you can do to deal with this is to try again.
So what can you do if you find yourself getting throttled?
First and foremost, you can spread out your requests. There's no limit for how many total requests you can do. If you space them out sufficiently, then you should have no issues. If you want to make 100 calls in one minute that will not work. In general 1 call/second should work under most circumstances. However, if traffic is high or there are extenuating circumstances it will not be enough. If we find out that people that are hacking the system looking for weak points start to do this as well, then we may need to lower the limits even more. But always check the HTTP status code. If you start getting the 429 status, stop wait a while before you restart.
Second, you can register your client. Registering a client only takes a minute and it increases the number of calls you can make before you are throttled. At this time, it should be around 2.5X higher. But again, that may change depending on usage. To register your client:
- Register your client via the API Client Registration form.
- Validate the client (this means that we will send a text to your cell phone of record with a code on it that you will then enter on the site)
- Pass the User-Agent you chose in the Client Registration on all API requests your client makes.
Other things you can do are just sound programming techniques, no matter the environment:
Cache the data whenever possible so you don't have to request it as often. Some requests like players doesn't change often, so don't request it often.
Don't make unnecessary calls. Make calls depending on the point we are on the season. Asking for stats and results for week 5 during week 3 makes no sense and yet there are a lot of such calls being made. Also understand the league parameters. Don't ask for a league draft results when they do an auction. Don't blindly request franchise data for franchises that don't exist.
Avoid making calls during high-traffic times. For instance during the NFL season we may lower the thresholds while games are going on. We may increase them during the late night/early morning hours.
If the requests are not league-specific, use api.myfantasyleague.com as the host. That will spread out your requests across a number of servers. The limits are applied on a per server basis.
Don't ever retry failures, especially ones with status code 429. Make sure you have the right parameters. Asking for league info for a league that doesn't exist still counts.
Send requests to the correct server and using the proper protocol (https: or http). Most requests are redirected to the proper server when necessary, but that counts as two separate requests.
Did we say space requests out? Yeah, but it's worth saying it again.
One other note: if you are making your requests via javascript from inside a league web page, then registering the client doesn't apply. In those cases your client is your browser. We will treat those requests as somewhere in-between un-registered and registered clients. You will be allowed more requests than if you are using an unregistered client but not as many as if it was fully registered. Using delays in this case to space out your requests will result in a very poor user experience so that's not a recommended approach. In this case we suggest you find a way to use less calls. Or if you do need to make more than the limit, then you probably need to come up with an asynchronous way to space them out that allows the rest of the page to work correctly during the breaks.
How helpful was this answer?
|
2. | I saw a really cool feature on someone else's site - how did they do that? Answer: Many of the more advanced customizations you might see on someone else's site requires an understanding of the web languages called XHTML, JavaScript and CSS. While MyFantasyLeague.com allows you to enter custom XHTML, JavaScript and CSS into your league pages to give you literally unlimited appearance options, we do not provide support for these web languages, so you'll need to learn about them on your own, or find someone who can help.
However, there are lots of other resources available to you to learn more about them, including:
- Our Community Forums - there, you'll find a lot of other helpful MyFantasyLeague.com customers who are experts in site customization, and would be very eager to lend a hand.
- This FAQ lists some third party companies that might help you with your design ideas, often times for a fee.
- An XHTML Tutorial.
- A CSS Tutorial.
- A JavaScript Tutorial.
- Your local bookstore, or an on-line bookstore, for books on XHTML, JavaScript, and CSS
How helpful was this answer?
|
3. | When I try to save HTML to my league pages, I get an error that says "Error - Message Cannot Contain These Tags..." - what does that mean? Answer: While we love the customizations that many of our customers are able to do to their MyFantasyLeague.com pages, there are certain HTML tags that can cause their league pages to become unusable. Those tags include:
- the start and end "html" tag.
- the start and end "body" tag.
- the start and end "textarea" tag.
And therefore, those specific HTML tags cannot be included in the HTML you use on your league pages. To fix this problem, simply remove these tags from the HTML you're using on your league pages, and then you'll be able to save any/all other HTML you'd like.
As a rule of thumb, inserting HTML (or CSS, or JavaScript) in your league pages should only be done by customers who truly understand all parts of the code they are adding to the site. If you paste code into your site that you do not understand, there's an excellent chance that it will cause you problems down the road.
How helpful was this answer?
|
4. | I've got some custom code entered into my site, and it's not working (or does not look the way I'd like it to) - can you help me fix it? Answer: While we cannot provide HTML and/or CSS support for custom code that's been written by our customers (or third parties), these tips might help a bit:
- If your custom HTML/CSS was written by a third party, please get in touch with that third party directly. If you're having a problem, there's an excellent chance that this is a problem they're aware of, and have already solved for someone before, so they'll be able to solve it for you in no time.
- If you've written your own custom HTML, you need to be sure that it's valid XHTML 1.0. One way to validate your HTML is the W3C (X)HTML validation service at http://validator.w3.org/.
- If you've written your own custom CSS, you need to be sure that it's valid CSS. One way to validate your CSS is the W3C CSS validation service at http://jigsaw.w3.org/css-validator/
- If your league web page does not appear as you'd like it to, you should first remove all of your custom code, and then add it back one piece at a time, until you find the offending code that makes your page appear incorrectly, and then fix the custom code in that specific module.
- Often times you'll find some other MyFantasyLeague.com customers on our Community Forums who are eager to help with your custom coding needs.
- If all else fails, and your league web pages are unusable to you because of these customizations, this detailed tip might help:
- Go directly to your For Commissioners > Setup > Printer Friendly page by clicking on that link.
- From there, if you know the offending code was custom HTML entered into one of the "home page messages", click on the home page message in question. If the offending code was CSS, click on the "Image and Other URLs" link.
- From the resulting page, if it does not work for you, just edit the URL of the page you're on by adding "&PRINTER=1" to the end of the URL. For example, if you know you were editing home page message #1 which caused the problem, you can go to this page, which gives you a "printer-friendly" version of the page (which eliminates the custom HTML and CSS).
- From there, you should be able to edit/save the HTML or CSS in question.
- If you still cannot edit/save the HTML or CSS in question, try using the web browser Firefox - it's much more forgiving of invalid HTML and CSS than Internet Explorer.
Finally, if none of the above helps, we can delete all of the offending custom HTML and/or CSS for you, allowing you to use your league pages again - just submit a support ticket to us requesting that we delete it for you.
A note to more advanced customers - if you're looking to really take your league web page design to the next level, and plan on spending a lot of time writing custom CSS and/or HTML, the combination of the Firefox web browser and the "Web Developer" extension for Firefox will save you a ton of time and frustration. See our Advanced Customization Guide for more details on how to use these two programs.
How helpful was this answer?
|
5. | How do I remove the header image from a skin? Answer: Some of our league skins have an image in the page header that some commissioners would like to remove. To remove the image the commissioner can add some custom CSS to their league via the Setup > league_id&C=IMAGES">Images & Other URL's
option. On that page is an option to "Upload League Cascading Style Sheet File:" from your computer. If you already have a file linked this way then you need to add to your existing CSS file and upload again. The following CSS code will remove the image from displaying for any skin you may select:
.pageheader::before { background-image: none; }
Note that although we offer the ability to customize league pages, we are unable to assist in the support of modifying your league appearance pages. If you wish to take your league pages to a more customized layout see the following league_id&FAQ=595> FAQ for details on how to do this.
How helpful was this answer?
|
6. | What "special" variables can I use in my custom code to make it generic across all leagues? Answer: One of the more common pitfalls of custom coding for MyFantasyLeague.com pages is writing code that you can share with other commissioners, and have that custom code automatically apply to their league without requiring them to edit it. To achieve that goal, all custom coding you enter and save into one of the various home page messages can use the following special variables. The special variables are automatically interpreted for the current league context.
In other words, instead of hard-coding a link to http://football5.myfantasyleague.com/2021/options?L=12345&O=07 for your rosters report, you make that link generic like this:
http://%HOST%/%YEAR%/options?L=%LEAGUEID%&O=07
The full list of custom variables follows:
- %HOST% = current league host, like football5.myfantasyleague.com
- %YEAR% = current year, like 2021
- %LASTYEAR% = last year, like 2020
- %NEXTYEAR% = next year, like 2022
- %LEAGUEID% = current five-digit league ID, like 12345
- %LEAGUENAME% = current league name, like "Dynasty Experts"
- %STATICHOST% = "static" league web server, like www5.myfantasyleague.com
- %FRANCHISEID% = current franchise id, like 0001
- %FRANCHISENAME% = current franchise name, like "Marauders"
How helpful was this answer?
|
7. | How do I take my league home page customization to the next level? Answer: We pride ourselves on having what we think is not only the most customizable on-line fantasy football league management service on the web, but also the most "open", too. What that "open-ness" means to you, if you're someone with some computer programming and/or web design skills, is that you can extend and customize your MyFantasyLeague.com league a great deal.
Advanced customization options include:
- Writing custom CSS to completely control all aspects of your league appearance.
- Getting access to "raw" MyFantasyLeague.com league data in industry-standard XML format.
- Using Your Own Domain For MyFantasyLeague.com Leagues and Content and Embedding league home page modules in other web pages.
Writing custom CSS to completely control all aspects of your league appearance
CSS (Cascading Style Sheets) is the industry-standard way of controlling all appearance-related items on web pages. MyFantasyLeague.com uses CSS to control league page appearance (including our skins), and also allows our customers to write their own CSS to completely control any/all page appearance options that you'd like to.
If you'd like to learn more about CSS, you might want to consider some on-line CSS tutorials, or visit your local or on-line bookstore for books on CSS - Eric Meyer seems to write especially good books on this topic.
Once you've learned CSS, next you'll have to learn a bit about the classes and IDs we use on the site. You can do that by setting up a free trial league on our site, and then doing a "View Source" to see our current CSS files, including the CSS files used for each of our skins, to get a better idea of how to write CSS for your MyFantasyLeague.com league pages.
Alternatively, here is another approach that might be easier, allowing you to see exactly what classes and IDs we use on your league pages:
- Download and install the Firefox web browser.
- Download and install the Web Developer Extension for Firefox.
- Go to the league page you're looking to customize.
- From the custom toolbar that gets installed, choose the "Information > Display ID And Class Details" option, and you can see exactly what IDs and classes are used on any/all pages on the site.
- Where this gets really cool is that you can edit the CSS right on the page, allowing you to immediately see the effects of your CSS changes right away. It will take a bit of time to play around with the web developer extension and learn about all of it's features and options, but this time will be very well spent if you're interested in really taking your design to the next level.
Finally, once you've written your custom CSS, you can go to the For Commissioners > Setup > Appearance Setup > Images & Other URLs page and upload your custom CSS to our site (or, simply enter the URL for the CSS file on your own server).
Getting access to "raw" MyFantasyLeague.com league data in industry-standard XML or JSON format
If you're a computer programmer, we offer the MyFantasyLeague.com Developer's Program whereby you can easily get access to raw MyFantasyLeague.com data in XML or JSON format. This will allow you to quickly and easily get that data into whatever programming environment you're most comfortable, be it PHP, ASP, Excel, Java, Perl, or any other programming language that's capable of reading XML or JSON files. This page
offers details of exactly what XML and JSON documents we offer via this service. For some examples of what others have done using our XML feed, see this FAQ
Using Your Own Domain For MyFantasyLeague.com Leagues and Content
All home page modules are "embeddable" - meaning, you can place "live" MyFantasyLeague.com content inside web pages on another web site, your "My Google" customized home page, or inside arbitrary HTML on your MyFantasyLeague.com-hosted pages. Check out the "Reports > League > Embed League Data" page available from all league pages to see how this option works. For examples of what some of our more creative customers have done with this feature, see http://uffle.com/
Some customers have set up a "framed" web sites to give their leagues a personalized home page URL, which just loads content from their league home page.
If you'd like to have your own custom domain name, but not have any actual content on your site, you can do what http://www.returnofthechampions.com/ has done, which issues an HTTP "redirect" to their real league home page on MyFantasyLeague.com.
If you have any suggestions, questions or comments about any of the programs mentioned here, we'd love to hear your feedback on via your "Help > Help Center" page.
How helpful was this answer?
|
8. | I want a high-end design for my league, but I don't have the skills to create it on my own - what can I do? Answer: MyFantasyLeague.com offers extensive customization options, but many of those options require knowledge of things web design, CSS, HTML and more. We understand that not everyone is able to do customizations on their own like that, but fortunately, we're aware of several third parties who are experienced in creating these designs, and might be willing to help you for a fee. They include:
- Custom League Designs
- DA GrafixDesigns
- My Fantasy Graphics
If you're aware of someone else who should be included in this list, please let us know.
How helpful was this answer?
|
9. | My league home page takes a long time to download (or doesn't download at all) - what's wrong? Answer: While MyFantasyLeague.com offers a ton of customization options, extensive customization of your league home page can have two very undesirable side-effects:
1 ) Adding a ton of customization to your league home page can cause your league pages to take a really long time to download to your computer. So, you need to decide what's more important to you - having a lot of custom content on your league home page, or having a fast-to-download league home page.
2 ) Adding customization to your league home page that's hosted on a third-party site may cause your home page to not download at all if that third party site is having problems.
So, before adding customization to your league home page, please be sure that you fully understand the above two relatively major down-sides of your customization efforts. You may have to delete the extra customizations you've entered if it's preventing your league-mates from using your league pages.
How helpful was this answer?
|
10. | What kinds of programs have third parties written using your Developer's Program? Answer: Because of our Developer's Program, we've had literally dozens of folks use our API to write third party apps to extend the functionality of MyFantasyLeague.com. Here's a partial list of these third party applications.
- Several iPhone and iPad apps for accessing your MyFantasyLeague.com leagues
- Some Android apps for accessing your MyFantasyLeague.com leagues.
- Some Windows Phone apps for accessing your MyFantasyLeague.com leagues.
- FantasySharks.com - lineup coach and draft coach to guide you through those tough weekly lineup and draft-day decisions.
- Draft Predictor for Windows
- PrimeTimeDraft.com for handling all of your in-person live draft needs, and allows you to quickly and easily upload your draft results to MyFantasyLeague.com.
- Cheat Sheet Wizard - the easiest way to nail your draft.
- Fandraft.com - allows you to hold your in-person draft, and then upload your draft results to your MyFantasyLeague.com league.
- Advanced Sports Logic The Machine - Football 2021 is the most advanced draft and in-season advisory tool available. Try it now free!
- MFLHistory.com - more detailed league history reporting.
- PickEmFirst.com - to find free agents in this league fast - works on any web site!
- MockDraftCentral.com - upload your draft results to your MyFantasyLeague.com league after your draft is over.
- FFToday.com's MFL Power - stats, rankings, projections, news and more. Also, FFToday.com's Draft Buddy.
- Habman's Apps - a ton of dynamic, flexible functionality can be added to your MFL league home page.
- LeagueSafe.com - makes managing your league finances easy!
- FootballGuys.com - one of the premier content sites on the web offers the Rate My Team application - available from any franchise's home page, this app will allow you to immediately have your team rated, and the Draft Dominator helps with your draft-day preparations.
- Big Time Fantasy Sports - FATbox makes running your auction a piece of cake!
- FantasyAlarm.com - text and email alerts to your phone.
- Fantasymojo.com's Colored Draft Grid
- 4for4.com's ADP Draft Planner
- Draft Analyzer - the ultimate draft analysis tool.
- This Node Package
- This Drupal Project
- PlayoffComputer.com - compute which teams have clinched a playoff spot (or top seed), been eliminated.
- Ranking Slash for Fantasy Football - customizes the FootballGuys.com player rankings to show who is available in each of your MyFantasyLeague.com leagues.
- Marvel Apps has created two iPhone/iPad apps: Fantasy Football Draft Assistant and Fantasy Football Top Trends.
If your favorite app isn't listed here, please let us know!
How helpful was this answer?
|
11. | How can I obtain the scores and status of in-progress NFL games? Answer: Starting with the 2020 season, the nflSchedule API request has been deprecated and should not be used. It had been replaced by static files which will improve the performance of the site greatly. To get the score and status for in-progress games you may request URLs like the following:
- In XML format: https://api.myfantasyleague.com/fflnetdynamic2020/nfl_sched_1.xml
- In JSON format: https://api.myfantasyleague.com/fflnetdynamic2020/nfl_sched_1.json
Change the '2020' for the current year and the '1' for the week number. You may also skip the week number in the URL (as in nfl_sched.xml) to return the entire NFL schedule for the specified year. The format of these files is identical to how the nflSchedule API request used to work.
The nflSchedule API will continue to work for the foreseeable future but it will not return the scores and status of in-progress NFL games. You can continue to use that request to obtain the NFL schedule for upcoming games and their times. Or you can use it to obtain the scores of games from previous weeks. However, it will be preferable to use the static files.
How helpful was this answer?
|
12. | How do I use the RSS Feed page? Answer: This screen allows you to get an RSS Feed of your key league data. RSS is a web feed
which allows you to get electronic news delivered to you in an industry-standard format.
To obtain an RSS Feed you can:
• | Click on the "Add To Google" button if you already have a Google account |
• | Click on the "My Yahoo" button if you already have a Yahoo!" account |
• | Copy the URL if you're using another RSS reader, and paste that URL into your RSS reader. |
Your league RSS feed will include:
1. Your league standings.
2. Current week's live scoring summary.
3. Most recent completed week's weekly results.
4. A summary of the 5 most recent league message board posts.
To Include Your RSS Feed Into Your Facebook Profile
1. | Copy your league's RSS URL above. |
2. | Log into your Facebook account |
3. | On the left-hand side of your page, you'll see a list of "Applications" - find the "Notes" application, and click on that. |
4. | On the right-hand side of that page, you'll see a link that says "Import A Blog" - click on that link. |
5. | Paste your RSS URL into the field on that page, check the disclaimer checkbox, and press the "Start Importing" button. |
6. | In the upper-right hand corner of the next page, click on the "Confirm Import" button, and you'll be good to go! |
How helpful was this answer?
|
13. | How do I embed a MyFantasyLeague.com Widget on another web page? Answer: This page allows you to embed your league home page modules into other web sites, including your personalized Google or Facebook home page.
You have some options to choose from to embed your league data.
- Google Home Page
- MyFantasyLeague.com Hosted Page
- On my Facebook profile
- Other Web Page
Select one of the above locations and then choose a MyFantasyLeague.com Module from the list of available modules. Then press the "Generate Code" button.
From the resulting page you will either click the button to "Add to Google" if the Google Home Page was selected, otherwise the necessary code will generate for you to copy/paste this module into either a MyFantasyLeague.com home page message or another personalized web page.
NOTE: You must know HTML in order to use the "In a MyFantasyLeague.com home page." and "In another web page." options on this page.
How helpful was this answer?
|
14. | Can I write a live draft client to interface with MyFantasyLeague.com's native live draft? Answer: Yes! If you're a developer who is familiar with our developer's program, the following tips will allow you to write an application that would interface directly with the MyFantasyLeague.com live draft, allowing your application to make picks to an MFL live draft, and follow along with the rest of the draft as it progresses on the MFL site. The information described here also applies for the most part to slow drafts as well.
Your application will need to be able to read the following XML files on a regular basis (preferably every 5 seconds or so to give the customer a near-real-time experience):
1 ) http://host.myfantasyleague.com/fflnetdynamic2021/league_id_LEAGUE_draft_results.xml - an XML file containing the current league draft order, including any picks made so far as well as information as to the current round/pick, the draft status, etc.
2 ) http://host.myfantasyleague.com/fflnetdynamic2021/league_id_LEAGUE_draft_status.xml - an XML file containing various status messages - for example, if a draft pick did not go through, why it was not allowed. This file might not exist at the beginning of a draft, so your program needs to properly handle a 404 (page not found) response from our server for this file.
3 ) http://host.myfantasyleague.com/fflnetdynamic2021/league_id_chat.xml - an XML file containing the latest league chat messages posted to the live draft room. This file might not exist if no chat messages have been written to your league, so your program needs to properly handle a 404 (page not found) response from our server for this file.
Note that host needs to be the actual server where the league is located. Unlike with regular API calls which redirect you to the proper server, there's no redirect here. Also, for Deluxe leagues, you must use the proper Unit value instead of 'LEAGUE' in the first two requests. The Unit will be something like CONFERENCE00 or DIVISION00. Requesting these XML files do not count against our new API rate limits. If you use the draftResults API request instead, those will count and your application will likely not be able keep up.
The above files are all that is needed to write an application that offers a real-time view into an MFL draft. To allow a customer to actually make draft picks from your application, you'll need the following information:
1 ) Establish a session to the MyFantasyLeague.com league in question following the "Login Required" instructions available on this page.
2 ) Make a call to the URL http://www03.myfantasyleague.com/2021/live_draft?L=league_id&CMD=DRAFT&PLAYER_PICK=player_id&ROUND=round&PICK=pick&JSON=1 where player_id is the player id to select. You also need to specify the ROUND and PICK for the current pick. This is new as of 2019 and it's required due to the client programs getting out of sync.
3 ) Also new for 2019, the success of the pick will be in the return from the call. This may be returned in JSON or XML format depending on the value of the JSON and XML parameters.
To allow the commissioner to make picks on behalf of another user, pass the FRANCHISE_PICK=franchise_id parameter in the live_draft call. Note that this is only used for validation and not to change the franchise that owns a pick. Similarly the ROUND and PICK parameters can not be used to change a draft pick other than the current pick.
Additional controls over the draft are possible using the following values for the CMD parameter:
PAUSE: pauses the draft timer. The timer must be running at the time for it to pause it.
RESUME: resumes the draft timer. The timer must be paused at the time. The timer restarts from where it left off or 15 seconds if it's under 15 seconds.
UNDO: undrafts the last draft pick made.
SKIP: skips the current draft pick.
These commands are only valid when coming from a user logged in as the commissioner.
Finally, to allow customers to write chat messages to the league, you'd need to establish a session to the site following the "Login Required" instructions available on this page, and then call a URL in this format:
http://www03.myfantasyleague.com/2021/chat_save?L=league_id&MESSAGE=url+encoded+message+to+post
and to direct a league chat message to an individual franchise (in this example, franchise id 0001), call "chat_save" like this:
http://www03.myfantasyleague.com/2021/chat_save?L=league_id&MESSAGE=url+encoded+message+to+post&TO_FID=0001
How helpful was this answer?
|
Didn't See Your Question Above? Please review the resources on the left-hand side of this page, or,
|