Region dependent API results?

184 views
Skip to first unread message

Jose Martin

unread,
Aug 31, 2016, 1:18:28 PM8/31/16
to Octopart API
Hello!

I'm currently working with the Octopart API to add live features to the google spreadsheet we use to arrange orders at my university laboratory.

The API calls are made using Google App Script, based on Paulo's work you featured some time ago. Using his JSON parsing functions, we are doing distributor SKU matching, since we have Qty, Distributor and SKU as inputs, and we need to match the supplier offer with that same SKU (since some suppliers have more than one with different packages/re-reeling).

However, I found that, using my API key, the results retrieved by the google app script are different from the results I get if I do the API call in my computer. I think it may be related to the country where the API call is triggered.

One example call is 
http://octopart.com/api/v3/parts/match?apikey=XXXXXX&queries=[{"mpn_or_sku":"2099223"}]&include[]=short_description

If it is called by Google, returns the prices for the Farnell SKU 2099223 in GBP. If it's triggered in my computer (from Spain), it returns in EUR.

So, my question is, are the API calls region dependant? How to specify the target region on the API call?

Thanks in advance

Regards,
Jose

Sam Bobb

unread,
Aug 31, 2016, 1:23:11 PM8/31/16
to Octopart API
Hello,

Yes the currency and offers are customized by location. You can override this by adding `&country=YY` where YY is the two-character ISO country code. So for your example, to specify Spain:

http://octopart.com/api/v3/parts/match?apikey=XXXXXX&queries=[{"mpn_or_sku":"2099223"}]&include[]=short_description&country=ES

Hope that helps!

Sam B
Octopart
Reply all
Reply to author
Forward
0 new messages