Tags

The Wellynews API


Word cloud by Wordle

A number of large news organisations have begun providing APIs to their content. These services allow content to be queried programmatically for use in mash ups and the like.

The Wellynews API lets you do something simular with the local newsitems indexed by Search Wellington.

For example, the API can provide a feed of local newsitems related to consultation; or maybe zebras. It can also handle potentially interesting combinations, such as what Wellington City Council has said about the Indoor Sports Centre or sculpture on the waterfront.

Getting started

Supported Formats

The API allows newsitems to be extracted in RSS or JSON (Javascript) formats. RSS is widely supported by feed readers, web browsers and server side libraries. JSON is typically used for passing data into browser based Javascript applications and mashups.

The desired format is specified by appending ethier rss or json to the end of the query url.

ie. Transport newsitems in RSS format:

or the same newsitems in JSON format:

Specifying tags and publishers

When querying for newsitems (below) you have the option of filtering by tag or publisher. Tags and publishers are specified by substituting the appropriate url snippet into your request.

ie. The url snippet for Wellington City Council is wellington-city-council.

A complete list of available tag and publisher url snippets is provided below.

Newsitem queries

The following types of newsitem query are supported.

Tag newitems

Returns newsitems tagged with a given tag.

ie. All newsitems tagged with soccer, in RSS format.

Publisher newsitems

Returns newsitems published by a specific publisher.

ie. newsitems published by the Capital Times, in JSON format.

Combinations

Returns newsitems tagged with a combination of two tags, or a publisher and a tag.

The tags are seperated with a plus character. For combinations involving a publisher, the publisher must always appear on the left hand side of the plus.

ie. newsitems tagged with transport and consultation and Wellington City Council media releases tagged with indoor sports centre.

Credit: The combination url scheme was inspired by the Guardian newspapers' tag combiners.

Commented newsitems

Returns newsitems which have been commented on.

ie. Commented newsitesm in JSON format.

Commented newsitems also specifiy the newsitems'comment feed url on the commentFeed field on the JSON results.

Commented newsitems for a tag

Returns commented newsitems for a given tag.

ie. Commented newsitems tagged with waterfront in JSON format.

Geotagged newsitems

Returns newsitems which have been geotagged.

ie. Geotagged newsitems in RSS format.

Pagination

Each RSS or JSON call returns a maximum of 30 results. For JSON calls, additional results can be obtained from using the page parameter to paginate through the results.

ie. page 6 of the Victoria University newsitems:

You can see the total number of available results in the totalItems field of the JSON results. The showingFrom and showingTo fields tell you which resuls you are currently viewing:


{
  "totalItems": 377,
  "showingFrom": 151,
  "showingTo": 180,
  "newsitems": [ ... ]
}

JSONP callbacks

You can specify that JSON results should be wrapped in a JSONP style callback, using the optional callback parameter. This is approch is required when making cross domain JSON calls from a web brower.

ie.

Your callback function name may contain letters, numbers and underscores only.

Geotagging

Where applicable, geotags are also embedded in our RSS feeds using the GeoRSS standard. A GeoRSS tagged feed item has this format:

<item>
<title>Can you replace the Hilton?</title>
<geo:lat>-41.284896</geo:lat>
<geo:long>174.778531</geo:long>
</item>

RSS to JSON feed mirroring

Provides JSON copies of local RSS feeds. This makes it easier to integrate feeds into sites using Javascript.

ie. Wellington City Councils' latest news feed as a JSON list:

A complete list of feed url snippets is provided below.

URL snippets

Available Tags
TagURL snippet
Accommodation accommodation
Animals animals
Architecture architecture
Art art
Beer beer
Blanket man blanket-man
Blogs blogs
Books books
Bus review bus-review
Business business
Busking busking
Cinema cinema
City Guides cityguides
Community Groups communitygroups
Conservation conservation
Earthquake earthquake
Earthquake strengthening earthquake-strengthening
Education education
Election 2013 candidates election-2013-candidates
election2011 election2011
Elections 2010 elections2010
Emergency Services emergencyservices
Events events
Fashion fashion
Featured featured
Fire ban fire-ban
Gay & Bisexual gaybisexual
Government government
Health health
Internet internet
Issues issues
Law law
Libraries libraries
liquor licensing liquor-licensing
Local History localhistory
Media media
Misc misc
MMA mma
Obituaries obituaries
Open data open-data
Performing Arts performingarts
Petone petone
Pies pies
Places places
Real Estate realestate
Restaurants and Bars restaurantsbars
Reviews reviews
Sausages sausages
Scraper required scraper-required
Snow snow
Sport sport
Stadium stadium
storm storm
Tourism tourism
Transport transport
Tsunami tsunami
Video video
Water restrictions water-restrictions
WCN Hosted wcnhosted
Webcams webcams
Wellington wellington
Zombies zombies
Available Publishers
PublisherURL snippet
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
Available RSS to JSON Feeds
FeedURL snippet

Usage Example

Example: Using JSON and Javascript to pull the latest transport newsitems into a page.

Transport

Source code

The Javascript source code for the above example is available below.

This example was implemented using the JQuery Javascript library. Any other JSON library could be used.

Following, is a line by line breakdown of what the example is doing:

Lines 1-2: HTML for the Transport heading and an emptry div tag which JQuery will write the newsitems into.

Line 4: Sourcing in the JQuery library file; you would normally do the in the head tag.

Lines 6-8: JQuery. Once the page has finished loading and is ready, fetch JSON data from the API and pass it to the function renderNewsitems.

Lines 10-16: JQuery. The renderNewsitems function is using JQuery to write out the first 4 items from the JSON data as HTML into the empty newsitems div.

Contact

Doing something interesting with this?

Contact enquires (at) wellington.gen.nz and let us know.



$site_information.trackingCode