Live Data Feed Integration
In the tradition of providing our affiliate partners the best services available. Not only do we offer you the standard links, but also a number of easy ways to integrate search results display for use within your own site.- Display realtime minimum, maximum and average prices on your website
- Easy to integrate data feed
- Results refined by either postcode, town name, or county
iframe Include
The table below shows an example of the iframe data feed showing Aldershot fuel prices:The code required to generate the above iframe is as follows:
<iframe style="border: 0px; width: 570px;" src="http://www.petrolprices.com/search-partner.html?search=aldershot"></iframe>
The data included in the iframe can be controlled through the use of the
search argument. This may be specified as a full postcode, part
postcode or town name. For example GU12, GU12 4RQ, and
Aldershot are all valid values for search.
Javascript Include
The table below shows an example of the Javascript data feed showing Aldershot fuel prices:The information box shows the minimum, maximum and average prices for each type of fuel in the Aldershot area from the last update. The area can easily be changed to suit your needs, if for example you want to show price data in a particular postcode, or county.
Here is the code required to generate the box used above:
<link rel="stylesheet" type="text/css" href="http://www.petrolprices.com/feeds/averages.css" /><script type="text/javascript" src="http://www.petrolprices.com/feeds/averages-basic.php?search_type=town&search_value=aldershot"></script>
You may change the following variables in the javascript include:
- search_type - valid values are: postcode, town, county
- search_value - example values: gu124rq, aldershot, hampshire
You may alter the way national averages look by using the following parameters:
- types - fuel types you would like to display (e.g. unleaded|diesel|super+unleaded)
- title - heading you would prefer to use (e.g. National+Average+Prices)
- simple - if set to 'true', will only display the average and not min. and max. values.
Advanced users may wish to change the style of the data feed box by excluding the stylesheet link in the above text and setting styles in their own stylesheet. Our stylesheet may be used as an example, and can be viewed here.
XML Data Feed
We provide a raw data feed for users who want to format their own price data display. The feed provides minimum, maximum and average prices for each type of fuel available in the specified area (or nationally if no area is specified).The same variables are available for use with the XML feed as with the Javascript include:
- search_type - valid values are: postcode, town, county
- search_value - example values: gu124rq, aldershot, hampshire
The feed may be cached if wished, and is updated every 24 hours Monday to Friday at or before 1pm. Therefore, it is recomended that users who choose to cache the data refresh their cache at least once every 24 hours.
Wordpress Widget
There is a WordPress plugin widget which makes use of the data feeds we provide. This makes it easy to include the averages, minimum and maximum price table on your WordPress blog.When used as a widget it is easy to install, configue and include in your blog's widgitized sidebar through the WordPress widget control panel. When used through the supplied WordPress shortcode the table can be included anywhere in your blog.
The plugin generates a table with an ID of petrolprices_averages to allow it to be easily styled.
Shortcode
The shortcode -- petrolprices -- can take two arguments to specify the location to display price data for. Excluding either of these arguments will cause UK wide price data to be displayed.- type - valid values are: postcode, town, county
- value - example values: gu124rq, aldershot, hampshire
[petrolprices type="town" value="aldershot"]
The plugin can be downloaded from its WordPress.org page.