Help for the ESPN API

version 2017.01.06.22


Test Mode 1

The parameter 'test' by itself parrots that value back. This can be used to verify that you are able to successfully connect to the API.

Example Link:

http://parfait.snarkybox.com/espn.php?test=true

What that link returns will look like this:

true


Test Mode 2

Adding the parameters 'feedtype' and 'feed' will dump the ESPN feed xml sent by ESPN, plus parrot back a table of all the possible parameters and their current values. For a list of supported feeds, please go to http://parfait.snarkybox.com/feeds-espn.php.

Example Link:

http://parfait.snarkybox.com/espn.php?test=true&feedtype=news&feed=news

What that link returns will look like this:


<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="http://sports.espn.go.com/rss/friendlyRSSDemo.xsl" type="text/xsl" media="screen"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:atom="http://purl.org/atom/ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
  <channel>
    <title>ESPN.com</title>
    <link>http://espn.go.com/</link>
    <description>Latest news from ESPN.com</description>
    <language>en-us</language>
    <atom:link rel="self" href="http://sports.espn.go.com/espn/rss/news?null"/>
    <lastBuildDate>Sat, 15 Nov 2014 05:32:56 PST</lastBuildDate>
    <docs>http://backend.userland.com/rss</docs>
    <managingEditor>webmaster@espn.go.com</managingEditor>
    <image>
      <url>http://a.espncdn.com/i/tvlistings/tv_espn_original.gif</url>
      <title>ESPN logo</title>
      <link>http://espn.go.com</link>
      <width>84</width>
      <height>34</height>
    </image>
    <ttl>30</ttl>
    <dc:rights>Copyright 2014</dc:rights>
    <admin:generatorAgent rdf:resource="http://espn.go.com/rss/?v=0.9beta"/>
    <admin:errorReportsTo rdf:resource="mailto:customer.service@espn.go.com"/>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
    <item>
      <dc:creator><![CDATA[Don Van Natta Jr.]]></dc:creator>
      <title><![CDATA[Sources: GM heard Rice's account to Goodell]]></title>
      <description><![CDATA[Ravens general manager Ozzie Newsome testified under oath Thursday he heard Ray Rice tell commissioner Roger Goodell during his June 16 disciplinary hearing that he had hit his then-fiancee in a casino hotel elevator, two sources told "Outside the Lines."]]></description>
      <pubDate>Fri, 7 Nov 2014 08:40:32 PST</pubDate>
      <guid isPermaLink="false">http://espn.go.com/espn/otl/story/_/id/11832947</guid>
      <link>http://espn.go.com/espn/otl/story/_/id/11832947/baltimore-ravens-general-manager-ozzie-newsome-testified-heard-ray-rice-tell-roger-goodell-elevator-incident-sources-say</link>
    </item>
    <item>
      <dc:creator><![CDATA[Associated Press]]></dc:creator>
      <title><![CDATA[LeBron nets 41 to lead Cavs' comeback win]]></title>
      <description><![CDATA[James scores 41, Cavaliers edge Celtics 122-121]]></description>
      <pubDate>Fri, 14 Nov 2014 22:55:42 PST</pubDate>
      <guid isPermaLink="false">http://scores.espn.go.com/nba/recap?gameId=400578417</guid>
      <link>http://scores.espn.go.com/nba/recap?gameId=400578417</link>
    </item>
  </channel>
</rss>

http://sports.espn.go.com/espn/rss/news

feedtype feed layer items test version
news news     true 2017.01.06.22

 


Items Parameter

Using the parameter 'items' will limit the numbers of items returned, regardless of how many are sent in the ESPN feed.

If the ESPN feed sends fewer items than requested using this parameter, the number of items actually in the ESPN feed are all that will be returned.


Complete Data Retrieval, Header

Using the parameters 'feedtype', 'feed' and 'layer' together will retrieve a '*' delimited, '~' line terminated, '|' layer terminated segment of ESPN elements. For a list of supported feeds, please go to http://parfait.snarkybox.com/feeds-espn.php.

'layer=head' will return a header information line.

Example Link:

http://parfait.snarkybox.com/espn.php?feedtype=news&feed=news&layer=head&items=6

What that link returns will look like this:

hd*ParfaitAPI*http://parfait.snarkybox.com/*espn***6*news*news*head*20141210*2109*68.100.18.139*2014.12.10.13~|

Element Names:

hd00 hd01 hd02 hd03 hd04 hd05 hd06 hd07 hd08 hd09
layer_code API identification API URL "espn" NULL NULL items parameter feedtype parameter feed parameter layer parameter
token string anyURI token NULL NULL token token token token

hd10 hd11 hd12 hd13
date of request (CCYYMMDD) time of request (HHMM) Remote IP Address parfait version
token token token token

Complete Data Retrieval, Meta Data Retrieval

Using the parameters 'feedtype', 'feed' and 'layer' together will retrieve a '*' delimited, '~' line terminated, '|' layer terminated segment of ESPN elements. For a list of supported feeds, please go to http://parfait.snarkybox.com/feeds-espn.php.

'layer=meta' will retrieve the meta data about the ESPN feed.

Example Link:

http://parfait.snarkybox.com/espn.php?feedtype=news&feed=news&layer=meta

What that link returns will look like this:

mt*ESPN.com*Latest news from ESPN.com*en-us*Sat, 15 Nov 2014 06:24:15 PST*webmaster@espn.go.com*30*Copyright 2014*hourly*1*2000-01-01T12:00+00:00~|

Field Names:

mt00 mt01 mt02 mt03 mt04 mt05 mt06 mt07 mt08 mt09
layer_code title description language lastBuildDate managingEditor ttl rights updatePeriod updateFrequency
token string string language datetime email nonNegativeInteger string string nonNegativeInteger

mt10
updateBase
datetime

Complete Data Retrieval, Other Data Retrieval

Using the parameters 'feedtype', 'feed' and 'layer' together will retrieve a '*' delimited, '~' line terminated, '|' layer terminated segment of ESPN elements. For a list of supported feeds, please go to http://parfait.snarkybox.com/feeds-espn.php.

'layer=other' will retrieve the other data about the ESPN feed.

Example Link:

http://parfait.snarkybox.com/espn.php?feedtype=news&feed=news&layer=other

What that link returns will look like this:

ot*http://espn.go.com/*http://sports.espn.go.com/espn/rss/news?null*http://espn.go.com/rss/?v=0.9beta*mailto:customer.service@espn.go.com*ESPN logo*http://a.espncdn.com/i/tvlistings/tv_espn_original.gif*http://espn.go.com*84*34~|

Field Names:

mt00 mt01 mt02 mt03 mt04 mt05 mt06 mt07 mt08 mt09
layer_code link atomLink generatorAgent errorReportsTo imageTitle imageURL imageLink imageWidth imageHeight
token anyURI anyURI anyURI string string anyURI anyURI nonNegativeInteger nonNegativeInteger

Complete Data Retrieval, Low Verbosity Data Retrieval

Using the parameters 'feedtype', 'feed' and 'layer' together will retrieve a '*' delimited, '~' line terminated, '|' layer terminated segment of ESPN elements. For a list of supported feeds, please go to http://parfait.snarkybox.com/feeds-espn.php.

'layer=low' will retrieve the ESPN feed items in a short form for all of the items contained in the espn feed.

Example Link:

http://parfait.snarkybox.com/espn.php?feedtype=news&feed=news&layer=low&items=3

What that link returns will look like this:

lo*00*Rich Cimini*Postgame profanity costs Jets' Ryan $100K*Sat, 15 Nov 2014 06:59:45 PST*http://espn.go.com/new-york/nfl/story/_/id/11875719/rex-ryan-new-york-jets-fined-100k-postgame-profanity~lo*01*Brett McMurphy*Source: Gators' Muschamp out after season*Sun, 16 Nov 2014 08:20:14 PST*http://espn.go.com/college-football/story/_/id/11885343/will-muschamp-return-florida-gators-coach-next-season~lo*02*ESPN.com news services*Peterson: NFL is being unfair, ignoring CBA*Sun, 16 Nov 2014 07:23:15 PST*http://espn.go.com/nfl/story/_/id/11885147/adrian-peterson-minnesota-vikings-says-nfl-being-unfair-ignoring-cba~|

Field Names:

lo00 lo01 lo02 lo03 lo04 lo05
layer_code item creator/author title pubDate link
token token string string datetime anyURI

 


Complete Data Retrieval, High Verbosity Data Retrieval

Using the parameters 'feedtype', 'feed' and 'layer' together will retrieve a '*' delimited, '~' line terminated, '|' layer terminated segment of ESPN elements. For a list of supported feeds, please go to http://parfait.snarkybox.com/feeds-espn.php.

'layer=high' will retrieve the ESPN feed items in a long form for all of the items contained in the espn feed.

Example Link:

http://parfait.snarkybox.com/espn.php?feedtype=news&feed=news&layer=high&items=3

What that link returns will look like this:

hi*00*Jets coach Rex Ryan was fined $100,000 by the league for his profane outburst after last Sunday's win over the Steelers, a source told ESPN.*http://espn.go.com/new-york/nfl/story/_/id/11875719~hi*01*Will Muschamp will not return as Florida's coach next season, a source told ESPN.*http://espn.go.com/college-football/story/_/id/11885343~hi*02*Minnesota Vikings star running back Adrian Peterson on Sunday denied that he backed out of a scheduled disciplinary hearing with the NFL on Friday, saying the league is trying to "impose a new process of discipline on me" and circumvent the CBA.*http://espn.go.com/nfl/story/_/id/11885147~|

Field Names:

hi00 hi01 hi02 hi03
layer_code item description guid
token token string string

 


Complete Data Retrieval, Combinations

Multiple 'layer' parameters can be sent by simply putting a comma between them: 'layer=meta,high' or 'layer=low,high'. This results in all of the data requested being returned in the same line, so you would first split them by a pipe, then a second split by a tilde. The first element of each segment is the layer_code, so inspecting the first four characters will tell you which segment you're working with. Splitting each of these segments by an asterisk will get each of the elements. For a list of supported feeds, please go to http://parfait.snarkybox.com/feeds-espn.php.

NOTE: the order in which the layer strings occur does not affect the output order. 'layer=meta,high' will have the same result as 'layer=high,meta'. The output order is always: Header, Meta, Other, Low Verbosity, High Verbosity

Example Link:

http://parfait.snarkybox.com/espn.php?feedtype=news&feed=news&layer=head,meta,low&items=3

What that link returns will look like this:

hd*espn***3*news*news*head,meta,low*20141116*1123*68.100.18.139*2014.11.16.12~|mt*ESPN.com*Latest news from ESPN.com*en-us*Sun, 16 Nov 2014 08:23:27 PST*webmaster@espn.go.com*30*Copyright 2014*hourly*1*2000-01-01T12:00+00:00~|lo*00*Rich Cimini*Postgame profanity costs Jets' Ryan $100K*Sat, 15 Nov 2014 06:59:45 PST*http://espn.go.com/new-york/nfl/story/_/id/11875719/rex-ryan-new-york-jets-fined-100k-postgame-profanity~lo*01*Brett McMurphy*Source: Gators' Muschamp out after season*Sun, 16 Nov 2014 08:20:14 PST*http://espn.go.com/college-football/story/_/id/11885343/will-muschamp-return-florida-gators-coach-next-season~lo*02*ESPN.com news services*Peterson: NFL is being unfair, ignoring CBA*Sun, 16 Nov 2014 07:23:15 PST*http://espn.go.com/nfl/story/_/id/11885147/adrian-peterson-minnesota-vikings-says-nfl-being-unfair-ignoring-cba~|

 


Error Messages

Should you accidentally use the API incorrectly or if the API didn't return any data from it's source feed, you may see one of two errors.

Missing API Parameters

If the API is unhappy about not being passed the appropriate parameters, you will see this message:

er*Missing API Parameters*It appears you have tried to access the API without passing all required parameters.*http://parfait.snarkybox.com/reuters.php*http://parfait.snarkybox.com/help-reuters.php~

No Data Returned

If for some reason the source feed didn't return any data to PARFAIT, you will see this message:

er*No Data Returned*It appears that no data was returned from the feed using the parameters you entered into the API.*http://parfait.snarkybox.com/reuters.php?feed=topneews&layer=low&items=3*http://parfait.snarkybox.com/help-reuters.php~

Field Names:

er00 er01 er02 er03 er04
layer_code error description source link help file link
token string string anyURI anyURI