FanFeedr Forums

Announcements

RSS Feed

API fixes and changes for 29 February 2012

    • ken
    • Topic created 2 years ago

    We wanted to let everyone know of the upcoming changes to the API. The push to production will occur on the afternoon of 29 February 2012 and will not result in any downtime.

    One note, we've added pagination in a backward-compatible way to many of the calls (listed below). We encourage everyone to start planning on incorporating the pagination into their software. Documentation will be updated to reflect these changes when we make the push to production.

    Thank you for your patience as we tackle some of these larger issues we've been experiencing.

    Here is a more detailed list of the outward facing changes:

    1. Several improvements to our event systems that will result in more accurate dates and times across sports.
    2. Correct player ID's will now be included in our boxscores.
    3. Some api calls will now have pagination. All calls with pagination will default to page 0 for compatibility reasons. They will also accept a get parameter 'page' which will specify which page should be returned (0 ... N). affected calls:
      • /persons call will now be restricted to 100 persons
      • /events call will now be restricted to 100 events
      • /events/preseason call will now be restricted to 100 events
      • /events/season call will now be restricted to 100 events
      • /events/postseason call will now be restricted to 100 events
      • /events/next call will now be restricted to 10 events
      • /events/last call will now be restricted to 10 events

    Please reply to this topic with any questions or comments.

    Message edited by ken 2 years ago

  1. WWarrior2 years ago

    Hi Ken,

    I'm hoping this is great news. :)

    Does this mean that the ingestion errors we've been experiencing over the last couple of months will be fixed with this push? Does this include any fixes to the rosters? What about the NBA games in the NHL schedules, etc?

    How do we know how many pages are available for the calls that will use the page parameter? It is easy to guess that the events call for an MLB team will be 2 pages long with the first page containing 100 and the second 62. With the next/last/*season calls how do you know how many pages to request?

    I'm guessing the page index is 0 based?

    Thanks!

    \ ^ / i l l

  2. ken2 years ago

    Hi WWarrior. This push does include fixes to roster ingestion and many other ingestion problems. As for schedules, this does not fix them, after we've confirmed that the push has been successful we will be rerunning events to fix all schedule/score issues and we can do the same for rosters. I'll be contacting you by email to try to confirm how far back this rerun of our ingestion should go to clean everything up. We'll run it in our staging environment first to confirm everythin goes smoothly and then we'll do the same for the public facing boxes.

    As for pagination, yes, it is 0 based. Also there is no call that returns the number of pages. We recommend calling for each page in sequence until you hit a page that has less then the expected number of results. I know this isn't convenient, but we its an improvment over how it works now, considering the next and last call didn't seem to ever return the amount of data the docs claimed it should, you'll find that even if you don't take advantage of pagination on those calls you'll still receive more events than you were previously.

    I hope I answered everything. Let me know if you have any more questions.

  3. matthewyo2 years ago

    Is this change now live?

  4. iRival2 years ago

    Howdy,

    Can you post a sample call with the "page" parameter? Based on convention I suppose that I can put the "&page=n" where "n" is the page I desire right after the api_key param, correct?

    Thanks,

    Bill

  5. ken2 years ago

    mathewyo, I'm sorry we didn't announce again in the forums but yes, the changes are live now.

    IRival, here you go: /events/season?api_key=XXX&page=2

  6. ken2 years ago

    Actually, I spoke too soon. The changes have not taken affect yet. Something went wrong switching DNS over to our new API cluster. We've switched it over now and it looks like everything is good. Let us know in the bugs forum if you notice any issues.

  7. iRival2 years ago

    Will you please post here when the changes are implemented?

    Thanks!

  8. ken2 years ago

    iRival, it seems that our DNS provider is having issues. We have switched our DNS entries to point at the new cluster twice now, and it has reverted back both times. I'll let you know when we have this settled.

  9. ken2 years ago

    I'm sorry about that, our old api gateway had a cronjob that was reverting the DNS entry. That has been removed and we've updated the DNS entry again. Please allow a few hours (24 at the most) for DNS to propagate if they have not taken affect in your area already.

  10. iRival2 years ago

    Howdy, Are you ready with the new API?

    Cheers,

    Bill

  11. ken2 years ago

    Everything seems fine on our end. Are you not seeing the changes?

  12. iRival2 years ago

    Howdy, I attempt this NBAL league teams call:

    http://ffapi.fanfeedr.com/bronze/api/leagues/f65226d8-fbf7-5033-a7a0-50de55b57968/teams?api_key=mykeyhere

    and I get "<h1>403 Developer Over Rate</h1>", so NO, I am not seeing any changes, or anything for that matter! Will you please assist, or direct me to a person that can assist? I will be checking the production logs for all activity to see how many calls I have made in production.

    Thanks,

    Bill

  13. ken2 years ago

    I drew up a report of your calls and it appears that you've attempted to make over 2400 calls every day this month so far, including today. If you'd like to continue this conversation by email, please send a message to: api (at) fanfeedr

  14. iRival2 years ago

    Thanks for verifying the call volumes. My report concurs as well,, so I will simply adjust the call frequencies to keep us under the limit. Thanks again,

    iRival

  15. iRival2 years ago

    Howdy,

    Instead of dynamically updating the scores as the events are in progress we would like to capture the final scores of the day's events for our targeted sports by making a single or very few calls late in the day to capture the "FINAL" status scores. Obviously timing is critical here as we need to get the scores before they are rolled over to make way for the next day's events, so my question is:

    Up until what time (we are on Central Time) can we get the day's events scores?

    Additionally we now want to display logos for the individual teams. I recall from some earlier research that you have them available via API calls so we have these questions:

    Is it permissible to store the logos on our server and if so is there any advantage to doing so?

    What is the most prevalent method of displaying logos, acquiring them and storing them on the client servers or accessing them from your servers on demand?

    Thanks

  16. ken2 years ago

    Hi, those are all great questions, I'll try to answer them as best as I can.

    Up until what time (we are on Central Time) can we get the day's events scores?
    

    The way the today call works is as follows:

    1. We convert the current time to the specified timezone (&timezone=est or pst or utc, utc is the default) and save the current date.
    2. We retrieve articles between 3am of that date in the specified timezone to 3am of the following day.

      Instead of dynamically updating the scores as the events are in progress we would like to capture the final scores of the day's events for our targeted sports by making a single or very few calls late in the day to capture the "FINAL" status scores. Obviously timing is critical here as we need to get the scores before they are rolled over to make way for the next day's events ...

    Given this explanation I would not recomment using the today call at all. I would recomment using the last call, that way you can make it at any time of your choice and go through the pages (backward in time) until you have all the events you want. If you are covering a whole league you can use api/league/league_id/events/last?api_key=XXX&timezone=est&page=N (pages are zero indexed and defaults to 0 if the page parameter is not present).

    Please also not though that the last call defaults to only 10 events per page and returns a different format (full event info for each event). The events returned are in the following format:

    1.     {
    2.         'id': String (UUID)
    3.         'name': String (Away team @ Home team)
    4.         'season_year': String (YYYY)
    5.         'season_type': String ('regular' or 'preseason' or 'postseason')
    6.         'date' String (ISO 8601)
    7.         'status' String
    8.         'home_team': Object ({
    9.                 'name': String (name)
    10.                 'abr': String (abbreviated name)
    11.                 'score': UInt (score)
    12.                 'id': String (UUID)
    13.             })
    14.         'away_team': Object ({
    15.                 'name': String (name)
    16.                 'abr': String (abbreviated name)
    17.                 'score': UInt (score)
    18.                 'id': String (UUID)
    19.             })
    20.     }
    Is it permissible to store the logos on our server and if so is there any advantage to doing so?
    

    It is permissible but we dont guarantee that the image will be there forever, for example if a teams name and logo changes. I would recommend you store the image, but also check to see if it changed every once in a while, I would check that the name didn't change, and if it did fetch it again. I would also store a hash of the file contents that way you can check to see if the logo image itself changed.

    What is the most prevalent method of displaying logos, acquiring them and storing them on the client servers or accessing them from your servers on demand?
    

    I'm sorry but I don't have any information as to what other users are currently doing with the logos.

    I hope I answered everything. Let me know if you have any more questions.

[ Page 1 of 1 ]