|
We provide a RESTful API to help you build Bravetrail's data into your own applications and services.
Authenticate user
http://bravetrail.com/api/key/<username>/<password>
If valid, returns the user's API Key required for authenticated requests. Output is plain text. Note when the user changes their password, their API Key is regenerated.
User Notes
http://bravetrail.com/api/notes/<username>/<api_key>
Returns the user's Notes recorded under their profile. Output is plain text.
To save new set of Notes to the user's profile, post the params <notes>, <username> and <api_key> to:
http://bravetrail.com/api/notes/save
Wish List
http://bravetrail.com/api/wish_list/<username>/<api_key>
Returns the user's Wish List.
To add a Product to the user's Wish List
http://bravetrail.com/api/wish_list/add/<upc_code>/<username>/<api_key>
To remove a Product from the user's Wish List
http://bravetrail.com/api/wish_list/remove/<upc_code>/<username>/<api_key>
Product Lookup by UPC
http://bravetrail.com/api/upc/<upc>
Append /<username>/<api_key> to the Product Lookup URL to return a flag of 'y' if the Product is on the user's Wish List.
Search Prices for a Product UPC Code
http://bravetrail.com/api/upc/<upc>/<latitude>/<longitude>/<radius>/<order>
Search Prices for a Product Name
http://bravetrail.com/api/name/<name>/<latitude>/<longitude>/<radius>/<order>
Search Prices from a Location
http://bravetrail.com/api/location/<location>/<latitude>/<longitude>/<radius>/<order>
Restrict Prices for a given user
Append /<show_only_user_prices>/<username>/<api_key> to the Price search URLs above. Note: setting <show_only_user_prices> to 'n' will list all prices as above, but will also show which products are on the user's Wish List
Add a new Price
Post the params <upc>, <name>, <location>, <price>, <latitude>, <longitude>, <share>, <username> and <api_key> to:
http://bravetrail.com/api/price/add
Note: UPC is optional. The currency and country used for the new price is taken from the user's profile
Params
<show_only_user_prices> is 'y' or 'n' - 'y' restricts prices to those entered by the user
<username> is the user's username
<password> is the user's plain text password
<api_key> is the user's API key
<upc> is the UPC code
<name> is the full/partial Product Name
<price> is the Product Price
<share> is 'y' or 'n' - determines if the new price should be visible by all users
<location> is the full/partial Store Name or Location
<latitude> and <longitude> is the geographic coordinates in decimal degrees
<radius> is the radius of the search area in kilometres
<order> is 'date_asc', 'date_desc', 'name_asc', 'name_desc', 'price_asc' or 'price_desc'
<notes> is the user's new set of notes
Note: for GET requests, remember to escape <username> and <password>
Output
Unless otherwise stated, output is in standard XML file format.