The infonews.co.nz API enables developers to access data from the infonews.co.nz database.
The API works over HTTP. By default, requests are HTTP GET requests and all arguments are passed as GET parameters. Return data is an XML data packet.
There are two methods available for the infonews.co.nz API, one to access news and one to access events.
If you have any further questions or would like to apply for access to the API please email fraser@infonews.co.nz.
News API
http://www.infonews.co.nz/api/news.cfm
Arguments
key
Required
API key which will be supplied to you.
v
Optional
Version of API. Default is 1.
t
Optional
Integer. The topic number.
l
Optional
Integer. The location number.
id
Optional
Integer. The news id number.
limit
Optional
Integer (1-100). Default is 30.
offset
Optional
Integer. Default is 1.
A call to the News method will return XML data ordered by date, with the most recent news first. If an id argument is given then only data for that one news story will be returned. Otherwise all news data will be returned up to a maximum of limit stories.
Note: You can access data for more than the 100 maximum by making further calls and using the offset argument. However, the API can only access the most recent 250 stories for any query.
Use t or l to limit the results by topic or location respectiviely. Check the url of a topic or location page from the Index to work out the integer for a topic or location. Note: Your API key may already restrict access to certain topics or locations by default.
Traffic builds up
http://www.infonews.co.nz/news.cfm?id=43789
TrafficWellingtonNew Zealand Police
Police are advising that the traffic flows on
the State Highway system and other main arterial routes leading back
into Wellington City are starting to build up.
Police are
urging all motorists to take care, show tolerance and display
patience toward other drivers.
All motorists need to be actively
aware of the driving conditions that they are confronting.
There
will be delays at different times and points but please be assured
everyone is working hard to ensure you get home safe and in a timely
manner.
]]>{ts '2009-10-26 17:29:25'}
View the story as it appears on infonews.co.nz here.
Example 2
If you are using Version 2 of the API, the xml returned will include photo data if there are photos linked to the news.
Police search for missing woman
http://www.infonews.co.nz/news.cfm?id=51581
PoliceWhanganuiNew Zealand Police
Police in Whanganui are searching for a woman
who is believed to have been missing for 10 days.
On
Monday, 19 April a bus driver spotted a woman sitting in a red Suzuki
Stationwagon on SH4, at the Lismore intersection. He later noticed
the same vehicle parked on ... Police search is asked to contact
Whanganui Police on 06 349 0600.
Media enquiries should
be referred to Communications Manager Kim Perks on 06 351 2546 or
027 234 8256.
]]>{ts '2010-04-29 20:11:32'}Mcgregor Marice.jpg
Marice Jane McGregor
New Zealand Police355
View the story as it appears on infonews.co.nz here.
Prefix the image name with http://www.infonews.co.nz/photos/ for the url of the photo. In this example the url would be:
43934Caution advised on Coromandel roads this weekend
http://www.infonews.co.nz/news.cfm?id=43934
TrafficCoromandelNew Zealand Police{ts '2009-10-29 14:44:22'}43855Appeal for crash witnesses to come forward
http://www.infonews.co.nz/news.cfm?id=43855
TrafficHuntlyNew Zealand Police{ts '2009-10-28 08:08:06'}
...
Events API
http://www.infonews.co.nz/api/events.cfm
Arguments
key
Required
API key which will be supplied to you.
v
Optional
Version of API. Default is 1.
t
Optional
Integer. The topic number.
l
Optional
Integer. The location number.
id
Optional
Integer. The news id number.
limit
Optional
Integer (1-100). Default is 30.
offset
Optional
Integer. Default is 1.
A call to the Events method will return XML data ordered by date, with the most current event first. If an id argument is given then only data for that one event will be returned. Otherwise all event data will be returned up to a maximum of limit stories.
Note: You can access data for more than the 100 maximum by making further calls and using the offset argument. However, the API can only access the next 250 upcoming events for any query.
Use t or l to limit the results by topic or location respectiviely. Check the url of a topic or location page from the Index to work out the integer for a topic or location. Note: Your API key may already restrict access to certain topics or locations by default.
This is a great opportunity
to try this unique sport, bring a friend and try our free trial with our INWA
Coach. Try this taster session and find out why Nordic Walking is one of the
most popular fitness programs in Europe, it's easy and it's fun.
Please bring water bottle, wear a hat and suitable shoes.
Location:
Botanical Gardens, Manurewa, Auckland
Date: Sunday 9.00 am - 10.00
am 13 February 2011
]]>capture12.jpg
Nordic Walking
Kay Livingstone
View the event as it appears on infonews.co.nz here.