Data provided by APIs can be provided and consumed via different formats including JSON, XML, RSS, CSV Files, etc. NYU’s best practice and default is to provide data in JSON format. Data provided by third party APIs may vary in format, it is always recommended to use JSON.
JSON – JavaScript Object Notation is an open-standard data format that uses human-readable text to transmit data objects consisting of attribute–value pairs and array data types. The data format is most popular and recommended for near realtime web and mobile application data exchange.
{
"term":"1168",
"term_descr":"Fall 2016",
"course_id":"070006",
"course_title":"Capital Program Management / Program Development",
"course_descr":"The course examines the process of capital program management and development...",
"course_contact_hrs":2.5,
"effective_date":"2014-05-01",
"effective_status":"A",
"class_type":"LEC",
"class_type_descr":"Lecture"
}
XML – eXtensible Markup Language is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable.
<root>
<term>1168</term>
<term_descr>Fall 2016</term_descr>
<course_id>070006</course_id>
<course_title>Capital Program Management / Program Development</course_title>
<course_descr>The course examines the process of capital program management and development...</course_descr>
<course_contact_hrs>2.5</course_contact_hrs>
<effective_date>2014-05-01</effective_date>
<effective_status>A</effective_status>
<class_type>LEC</class_type>
<class_type_descr>Lecture</class_type_descr>
</root>
RSS – Rich Site Summary; originally RDF Site Summary; often called Really Simple Syndication is type of data format similar to XML which allows users to access updates to online content in a standardized, computer-readable format. These feeds can, for example, allow a user to keep track of many different websites in a single news aggregator.
<rss version="2.0">
<channel>
<item>
<title>Spring Break</title>
<link>http://events.nyu.edu/#!view/event/event_id/204203</link>
<pubDate>Sat, 17 Mar 2018 05:00:00 +0000</pubDate>
<guid isPermaLink="true">http://events.nyu.edu/#!view/event/event_id/204203#204203</guid>
<livewhale:type>events</livewhale:type>
<livewhale:id>204203</livewhale:id>
<livewhale:timezone>America/New_York</livewhale:timezone>
<livewhale:all_day>1</livewhale:all_day>
<livewhale:categories>Dates - Deadlines|Programs|Campus Life</livewhale:categories>
<livewhale:ends>Mon, 19 Mar 2018 04:00:00 +0000</livewhale:ends>
<source url="Campus Life Events">Campus Life Events</source>
</item>
</channel>
</rss>