Programmatically detect whether Amazon buyer has left a review? - api

Is it possible to programmatically detect whether an Amazon buyer has left a review on a product? I've been digging through the Product Advertising API to no avail.

you can use retrieving customer reviews portion of the api here:
http://docs.aws.amazon.com/AWSECommerceService/latest/DG/EX_RetrievingCustomerReviews.html
Here is an example of the request:
http://webservices.amazon.com/onca/xml?
Service=AWSECommerceService
&Operation=ItemLookup
&ResponseGroup=Reviews
&IdType=ASIN
&ItemId=B004HFS6Z0
&AssociateTag=[Your_Associate_Tag]
&AWSAccessKeyId=[Your_AWSAccessKeyId]
&Timestamp=[YYYY-MM-DDThh:mm:ssZ]
&Signature=[Request_Signature]
and response:
<Item>
<ASIN>B004HFS6Z0</ASIN>
<CustomerReviews>
<IFrameURL>
http://www.amazon.com/reviews/iframe?
akid=[Your_AWSAccessKeyId]
&alinkCode=xm2
&asin=B004HFS6Z0
&atag=[Your_AssociateTag]
&exp=2011-06-01T22%3A32%3A53Z
&v=2
&sig=pxn6bbln%2B%2FVTPJdj8oCcXvjTHmo3spkUMjbQMPbhCKI%3D
</IFrameURL>
<HasReviews>true</HasReviews>
</CustomerReviews>
</Item>
you could then sort the responses if needed.

Related

SupplyCategoryUnavailable - what does this FBAOutboundServiceMWS error mean?

We have a script for submitting Amazon FBA orders via FBAOutboundServiceMWS, using CreateFulfillmentOrder request.
Orders for some products cannot be placed, we are getting this error:
<ErrorResponse xmlns="http://mws.amazonaws.com/FulfillmentOutboundShipment/2010-10-01/">
<Error>
<Type>Sender</Type>
<Code>InvalidRequestException</Code>
<Message>Value SupplyCategoryUnavailable for parameter MerchantSku is invalid.</Message>
</Error>
<RequestId>22dafce7-7457-4232-b994-efea4f386dca</RequestId>
</ErrorResponse>
There is no information about it in a documentation, and we do not see any difference between products which experience the issue and products which do not.
As it turned, those were SKUs called SNL – small and light program with amazon.com.
Below an answer from Amazon customer support which we have received:
Please confirm with if the items meet these conditions:
Weigh less than or equal to 8 ounces
Have dimensions less than or equal to 9x6x2 inches
Priced under $10
If the above mentioned conditions are met you have to do it manually

Yahoo Weather API 3 days Forecast with humidity value

I am building a web app, which uses Yahoo Weather API to provide weather information, based on a ZIP code, provided by the users.
I know that in order to obtain this data for certain number of days I have to add it as a parameter in my request, like so:
http://weather.yahooapis.com/forecastrss?p=33035&u=c&d=3
Which gives this result:
<channel>
....
<yweather:location city="Homestead" region="FL" country="US"/>
<yweather:units temperature="C" distance="km" pressure="mb" speed="km/h"/>
<yweather:wind chill="19" direction="90" speed="11.27"/>
<yweather:atmosphere humidity="78" visibility="16.09" pressure="1021" rising="1"/>
<yweather:astronomy sunrise="7:12 am" sunset="7:36 pm"/>
...
<item>
...
<yweather:forecast day="Wed" date="2 Apr 2014" low="19" high="28" text="Mostly Sunny" code="34"/>
<yweather:forecast day="Thu" date="3 Apr 2014" low="21" high="29" text="Partly Cloudy" code="30"/>
<yweather:forecast day="Fri" date="4 Apr 2014" low="20" high="28" text="Partly Cloudy" code="30"/>
<guid isPermaLink="false">USFL0208_2014_04_04_7_00_EDT</guid>
</item>
</channel>
However I need to be able to get the humidity level for EVERY day in the forecast and not just the current one. I've tried to find solution here and also read the Yahoo API documentation, but it's really a short one.
I've also tried http://www.myweather2.com/ and http://developer.worldweatheronline.com/, but they have the same issue with humidity - it's shown only for the current day and stripped from the whole forecast.
I'll keep trying with other free Weather APIs, but if you can help here I'd be very grateful.
I've spent some time researching for better APIs than the Yahoo! Weather API and I found something, that works for me, so I've decided to share the info, in case anyone else bump into this some day.
Version 2 of the Forecast API looks like a nice solution, because it provides detailed information, more specifically the humidity index for each day in the forecast, which was what I was looking for in the first place.
There are also number of libraries for this API (languages include PHP, Node.js, Python, Perl and others).
It works with longitude & latitude as in this example
https://api.forecast.io/forecast/APIKEY/LATITUDE,LONGITUDE,TIME
and of course one needs to register for an API key.
The TIME parameter is optional, the temperature uses Fahrenheit metrics by default, but this can be changed with additional ?units=ca parameter.
One disadvantage is that you get only a 1,000 free calls per day, which probably won't be suitable for big applications.
If you know a better answer to the original question, I'll be very happy to hear it. Until then I'll use this solution, without going into much details:
// The default result from a Forecast API call is in JSON,
// so decode it to an object for easier access
$fcObj = json_decode($jsonResult);
if(!empty($fcObj->daily->data[0]->humidity)) {
// get humidity value in %
$humidty = $fcObj->daily->data[0]->humidity * 100;
}

Clearer response from BigCommerce

Can BigCommerce change their API response to be more clear when a program tries to post a shipment that already exists?
When posting shipments to BigCommerce, if the shipment already exists, then you receive the following error message.
<?xml version="1.0"?>
<errors>
<error>
<status>400</status>
<message>The field 'quantity' is invalid.</message>
<details>
<invalid_reason>The quantity specified is greater than the quantity of the product that is available to ship.</invalid_reason>
<available_quantity>0</available_quantity>
<order_product_id>628</order_product_id>
</details>
</error>
</errors>
I agree that it is a bad request, but it has nothing to do with the quantity of the item. Can we do something like the following for the message or invalid_reason instead?
The shipment [insert ID here] already exists and cannot be added.
This would make for a much more usable API.
When querying the order products resource there is an available quantity to ship, and as you create a shipment(s) the available quantity is reduced to 0.
Initially a shipment POST is successful as the quantity specified in the payload matches that of the order. If you were to POST a shipment to an order that has already been shipped then the available quantity is actually 0, and when you specify a positive integer for quantity in the payload it is invalid and greater than the available quantity, so the error is accurate.

How can I search for albums with generic titles using the Spotify Web API?

It is possible to search by name for an album in the Spotify catalog using the Spotify Web API.
However, if the album name is a common word or phrase, the search response may contain thousands of results. I can't see a way to narrow the search by artist name.
Here is an example: searching for album Country by artist Giant Panda Guerilla Dub Squad.
The API request is:
http://ws.spotify.com/search/1/album?q=country
The response is:
<?xml version="1.0" encoding="UTF-8"?>
<albums xmlns="http://www.spotify.com/ns/music/1" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">
<opensearch:Query role="request" startPage="1" searchTerms="country" />
<opensearch:totalResults>11861</opensearch:totalResults>
<opensearch:startIndex>0</opensearch:startIndex>
<opensearch:itemsPerPage>100</opensearch:itemsPerPage>
<album href="spotify:album:1Wcnyz2zYWLIPZ1K63RXdW">
<name>How Country Feels</name>
<artist href="spotify:artist:56x8mYvS3cyDGAi8N2FxbB">
<name>Randy Houser</name>
</artist>
<id type="upc">886443789852</id>
<popularity>0.73964</popularity>
<availability>
<territories>CA US</territories>
</availability>
</album>
...more albums...
</albums>
There are 11861 results, and the results are paged, with 100 albums per page. A request can be made to get the next page, but if the album I'm looking for is on the last page I will have to make 118 separate requests to the API before I find it.
Is there a better way?
You can use the advanced search query language to help, especially if you know the artist in advance. For example:
http://ws.spotify.com/search/1/album?q=artist:Giant Panda Guerilla Dub Squad
...will limit the search to albums by that artist.
http://ws.spotify.com/search/1/album?q=artist:Giant Panda Guerilla Dub Squad Country
...will return only the album you want.
The full advanced search reference is currently unavailable in the chaos that was the new Spotify redesign, but you can find it in the Wayback machine here.

Google Stocks API

I'm developing a bot, and I want to use the Google's Stock's API shown here:
http://jarloo.com/tutorials/google-stock-api/
The only problem is, It was a feature request from someone else and I don't know a lot about stocks. I see that it is 'undocumented', but does anything have an links to information that I can get what each of the tags from the return is? A Sample return for yahoo is below.
<xml_api_reply version="1">
<finance module_id="0" tab_id="0" mobile_row="0" mobile_zipped="1" row="0" section="0">
<symbol data="YHOO"/>
<pretty_symbol data="YHOO"/>
<symbol_lookup_url data="/finance?client=ig&q=YHOO"/>
<company data="Yahoo! Inc."/>
<exchange data="Nasdaq"/>
<exchange_timezone data="ET"/>
<exchange_utc_offset data="+05:00"/>
<exchange_closing data="960"/>
<divisor data="2"/>
<currency data="USD"/>
<last data="13.59"/>
<high data="13.62"/>
<low data="13.36"/>
<volume data="30493456"/>
<avg_volume data="24328"/>
<market_cap data="17706.97"/>
<open data="13.50"/>
<y_close data="13.48"/>
<change data="+0.11"/>
<perc_change data="0.82"/>
<delay data="0"/>
<trade_timestamp data="6 hours ago"/>
<trade_date_utc data="20110721"/>
<trade_time_utc data="200014"/>
<current_date_utc data="20110722"/>
<current_time_utc data="024141"/>
<symbol_url data="/finance?client=ig&q=YHOO"/>
<chart_url data="/finance/chart?q=NASDAQ:YHOO&tlf=12"/>
<disclaimer_url data="/help/stock_disclaimer.html"/>
<ecn_url data=""/>
<isld_last data="13.60"/>
<isld_trade_date_utc data="20110721"/>
<isld_trade_time_utc data="235853"/>
<brut_last data=""/>
<brut_trade_date_utc data=""/>
<brut_trade_time_utc data=""/>
<daylight_savings data="true"/>
</finance>
</xml_api_reply>
Sorry if this isn't exactly a 'programming' question. Thanks for any help you can provide.
Since Google Finance API is now deprecated, I would suggest you to use the Yahoo! Finance API instead:
http://finance.yahoo.com/d/quotes.csv?s=STOCK_SYMBOLS separated by “+” &f= special_tags
Here is a list of the special tags you may find useful:
http://www.gummy-stuff.org/Yahoo-data.htm