GET tweets.json


Updated 13th December 2012

Returns traffic tweets based on inputted parameters. The data set contains the basic tweet details for reliable traffic tweets. For additional data, including tweet entities, I recommend using the Twitter API against the tweet_id value. All data is returned by its time descending.

Example requests

http://api.twitraffic.co.uk/1.1/tweets.json?api_key=demokey&road=M5&direction=southbound&traffic_source=all&traffic_type=roadworks

http://api.twitraffic.co.uk/1.1/tweets.json?api_key=demokey&road=M1&traffic_source=realuser

http://api.twitraffic.co.uk/1.1/tweets.json?api_key=demokey&road=A46&count=50&retweets=false


Parameters
api_key
(Required)
An activate API key verifies the user of the service.
count
(Optional)
Number of tweets to return.

Default: 25
road
(Optional)
Returns traffic confined to a specific road.

Example values: M1, M5, A429
direction
(Optional)
Returns traffic confined to a specific road direction.

Note: Requires the road parameter
Example values: northbound, soundbound, anti-clockwise
junction
(Optional)
Returns traffic confined to a specific motorway junction.

Note: Requires the road parameter
min_score
(Optional)
As tweets are score weighted, this allows you to filter to a specific level of accuracy.

Examples values: 5, 8, 15
Default: 1
min_sentiment_score
(Optional)
Each tweet has a sentiment score applied to its status. This is an indicator to whether the tweet has a positive, negative or neutral sub-text. Most tweets about traffic are obviously negative.

Examples values: -0.555, 1.25, 0
Default: 0
max_sentiment_score
(Optional)
Each tweet has a sentiment score applied to its status. This is an indicator to whether the tweet has a positive, negative or neutral sub-text. Most tweets about traffic are obviously negative.

Examples values: -0.555, 1.25, 0
traffic_type
(Optional)
Returns traffic of certain characteristics.

Options: incidents, roadworks, all
Default: all
traffic_source
(Optional)
Returns traffic based on whether the user is deemed a trusted source or individual Twitter user.

Options: realuser, trusted, all
Default: all
retweets
(Optional)
Boolean whether to display tweets which have been re-tweeted from another user.

Options: true, false
Default: false
start_index
(Optional)
Returns results starting from a specific database index.

Options: 1, 8, 12250
Default: 0
start_timestamp
(Optional)
Returns results starting from a specified UNIX timestamp.

Default: Current UNIX timestamp
tweet_id
(Optional)
Returns a single tweet based on its twitter status id.
database_id
(Optional)
Returns a single tweet based on the Twitraffic database id.
username
(Optional)
Returns traffic tweets from a specific Twitter username.
geocode
(Optional)
Returns the nearest geo-tagged traffic tweets from a specific GPS location. The parameter value is specified by "latitude,longitude,radius (km)".