Help for the NASA 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/nasa.php?test=true

What that link returns will look like this:

true


Test Mode 2

Adding the parameter 'feed' will dump the NASA feed xml sent by NASA, 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-nasa.php.

Example Link:

http://parfait.snarkybox.com/nasa.php?test=true&feed=breaking_news

What that link returns will look like this:


<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:media="http://search.yahoo.com/mrss/" version="2.0" xml:base="http://www.nasa.gov/">
  <channel>
    <title>NASA Breaking News</title>
    <description>A RSS news feed containing the latest NASA news articles and press releases.</description>
    <link>http://www.nasa.gov/</link>
    <atom:link rel="self" href="http://www.nasa.gov/rss/dyn/breaking_news.rss"/>
    <language>en-us</language>
    <managingEditor>jim.wilson@nasa.gov</managingEditor>
    <webMaster>brian.dunbar@nasa.gov</webMaster>
    <docs>http://blogs.harvard.edu/tech/rss</docs>
    <item>
      <title>NASA Television to Provide Coverage of European Mission Comet Landing</title>
      <link>http://www.nasa.gov/press/2014/november/nasa-television-to-provide-coverage-of-european-mission-comet-landing</link>
      <description>NASA Television and the agency’s website will provide live coverage from 9-11:30 a.m. EST (6-8:30 a.m. PST) of the European Space Agency (ESA) Rosetta mission’s scheduled landing of a probe on a comet on Wednesday, Nov. 12.</description>
      <guid isPermaLink="false">http://www.nasa.gov/press/2014/november/nasa-television-to-provide-coverage-of-european-mission-comet-landing</guid>
      <pubDate>Fri, 07 Nov 2014 12:00:00 EDT</pubDate>
      <source url="http://www.nasa.gov/rss/dyn/breaking_news.rss">NASA Breaking News</source>
    </item>
    <item>
      <title>Mars Spacecraft Reveal Comet Flyby Effects on Martian Atmosphere</title>
      <link>http://www.nasa.gov/press/2014/november/mars-spacecraft-reveal-comet-flyby-effects-on-martian-atmosphere</link>
      <description>Two NASA and one European spacecraft that obtained the first up-close observations of a comet flyby of Mars on Oct. 19, have gathered new information about the basic properties of the comet’s nucleus and directly detected the effects on the Martian atmosphere.</description>
      <guid isPermaLink="false">http://www.nasa.gov/press/2014/november/mars-spacecraft-reveal-comet-flyby-effects-on-martian-atmosphere</guid>
      <pubDate>Fri, 07 Nov 2014 12:00:00 EDT</pubDate>
      <source url="http://www.nasa.gov/rss/dyn/breaking_news.rss">NASA Breaking News</source>
    </item>
  </channel>
</rss>

http://feeds.nasa.com/nasa/breaking_news?format=xml

feed layer items test version
breaking_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 NASA feed.

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


Complete Data Retrieval, Header

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

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

Example Link:

http://parfait.snarkybox.com/nasa.php?feed=breaking_news&layer=head&items=6

What that link returns will look like this:

hd*ParfaitAPI*http://parfait.snarkybox.com/*nasa***6**breaking_news*head*20141210*2113*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 "nasa" NULL NULL items parameter NULL feed parameter layer parameter
token string anyURI token NULL NULL token NULL 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 'feed' and 'layer' together will retrieve a '*' delimited, '~' line terminated, '|' layer terminated segment of NASA elements. For a list of supported feeds, please go to http://parfait.snarkybox.com/feeds-nasa.php.

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

Example Link:

http://parfait.snarkybox.com/nasa.php?feed=breaking_news&layer=meta

What that link returns will look like this:

mt*NASA Breaking News*http://www.nasa.gov/*http://www.nasa.gov/rss/dyn/breaking_news.rss*en-us*A RSS news feed containing the latest NASA news articles and press releases.*jim.wilson@nasa.gov*brian.dunbar@nasa.gov~|

Field Names:

mt00 mt01 mt02 mt03 mt04 mt05 mt06 mt07
layer_code title link atomLink language description managingEditor webMaster
token string anyURI anyURI language string email email

Complete Data Retrieval, Low Verbosity Data Retrieval

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

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

Example Link:

http://parfait.snarkybox.com/nasa.php?feed=breaking_news&layer=low&items=3

What that link returns will look like this:

lo*00*NASA Opens Registration for 2015 Exploration Rover Challenge*http://www.nasa.gov/press/2014/november/nasa-opens-registration-for-2015-exploration-rover-challenge*Fri, 14 Nov 2014 12:00:00 EDT*http://www.nasa.gov/rss/dyn/breaking_news.rss~lo*01*NASA Commercial Crew Partners Continue System Advancements*http://www.nasa.gov/press/2014/november/nasa-commercial-crew-partners-continue-system-advancements*Fri, 14 Nov 2014 12:00:00 EDT*http://www.nasa.gov/rss/dyn/breaking_news.rss~lo*02*NASA Awards NASA Balloon Operations Contract*http://www.nasa.gov/press/2014/november/nasa-awards-nasa-balloon-operations-contract*Thu, 13 Nov 2014 12:00:00 EDT*http://www.nasa.gov/rss/dyn/breaking_news.rss~|

Field Names:

lo00 lo01 lo02 lo03 lo04 lo05
layer_code item title link pubDate sourceURL
token token string anyURI string anyURI

 


Complete Data Retrieval, High Verbosity Data Retrieval

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

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

Example Link:

http://parfait.snarkybox.com/nasa.php?feed=breaking_news&layer=high&items=3

What that link returns will look like this:

hi*00*NASA has opened team registration for the 2015 NASA Human Exploration Rover Challenge. Organized by NASA's Marshall Space Flight Center in Huntsville, Alabama, the event will be held April 16-18, 2015, at the U.S. Space & Rocket Center, also in Huntsville.*http://www.nasa.gov/press/2014/november/nasa-opens-registration-for-2015-exploration-rover-challenge~hi*01*NASA's industry partners continue to complete development milestones under agreements with the agency’s Commercial Crew Program. The work performed by Blue Origin, Boeing, Sierra Nevada Corporation and SpaceX during partnership and contract initiatives are leading a new generation of safe, reliable and cost-effective crew space transportation systems to low-Earth orbit destinations.*http://www.nasa.gov/press/2014/november/nasa-commercial-crew-partners-continue-system-advancements~hi*02*NASA has awarded the NASA Balloon Operations Contract to Orbital Sciences Corporation of Greenbelt, Maryland for engineering and operations services to support the NASA Balloon Program.*http://www.nasa.gov/press/2014/november/nasa-awards-nasa-balloon-operations-contract~|

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-nasa.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, Low Verbosity, High Verbosity

Example Link:

http://parfait.snarkybox.com/nasa.php?feed=breaking_news&layer=head,meta,low&items=3

What that link returns will look like this:

hd*nasa***3**breaking_news*head,meta,low*20141116*1120*68.100.18.139*2014.11.16.12~|mt*NASA Breaking News*http://www.nasa.gov/*http://www.nasa.gov/rss/dyn/breaking_news.rss*en-us*A RSS news feed containing the latest NASA news articles and press releases.*jim.wilson@nasa.gov*brian.dunbar@nasa.gov~|lo*00*NASA Opens Registration for 2015 Exploration Rover Challenge*http://www.nasa.gov/press/2014/november/nasa-opens-registration-for-2015-exploration-rover-challenge*Fri, 14 Nov 2014 12:00:00 EDT*http://www.nasa.gov/rss/dyn/breaking_news.rss~lo*01*NASA Commercial Crew Partners Continue System Advancements*http://www.nasa.gov/press/2014/november/nasa-commercial-crew-partners-continue-system-advancements*Fri, 14 Nov 2014 12:00:00 EDT*http://www.nasa.gov/rss/dyn/breaking_news.rss~lo*02*NASA Awards NASA Balloon Operations Contract*http://www.nasa.gov/press/2014/november/nasa-awards-nasa-balloon-operations-contract*Thu, 13 Nov 2014 12:00:00 EDT*http://www.nasa.gov/rss/dyn/breaking_news.rss~|

 


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