Octopart in Excel: queries uses wrong distributor

609 views
Skip to first unread message

Francois De La Roche

unread,
Jul 31, 2013, 1:28:19 PM7/31/13
to octopa...@googlegroups.com
Hi

I just started using the Octopart API for my personal excel BOMs, I followed the setup on your blog post:
http://octopart.com/blog/archives/2013/7/octopart-in-excel

However, I have troubles with passing the distributor argument to the query.
It looks like despite all my effort, queries uses a "default" distributor (Newark?).

For example:
=disty_url("Digi-Key", "BAS40BRW-7-F")

Result:

http://octopart.com/click/vptrack?ak=97346f4a&sig=0a79b6a&vpid=22464999


will redirect to Newark page for the BAS40BRW-7-F part.

Another example:
=disty_url("Mouser", "CRCW12100000Z0EA")

Result:

http://octopart.com/click/vptrack?ak=97346f4a&sig=05ddcac&vpid=11404169

also redirect to Newark.

And same for distributor price and stock queries.

In the disty_url function, I have tried changing:
query_params = [
        { 'seller' : distributor,
          'mpn_or_sku' : mpn_or_sku }
        ]

To:
    query_params = [
        { 'seller' : 'Digi-Key',
          'mpn_or_sku' : mpn_or_sku }
        ]

but it did not help.

Could you please help solving this distributor mismatch?

Thank you!
Francois


Christopher Calvi

unread,
Aug 1, 2013, 11:17:54 AM8/1/13
to octopa...@googlegroups.com
Hi Francois,

I apologize for that bug!

I have corrected it and attached the updated functions.py file that you should use.  Don't forget to change the API key before using.

The file has also been corrected in the original blog post.

Let us know if you continue to have any issues.

Thank you,
Chris
functions.py

Francois De La Roche

unread,
Aug 1, 2013, 1:31:47 PM8/1/13
to octopa...@googlegroups.com
Hi Christopher,

Thanks for the correction!

I have another question about the API.

I know I'm picky but, for some parts, displayed stock does not match exactly the remaining stock showed on the distributor website.

For example, I have a attached a spreadsheet with one part at two different suppliers (Mouser and Digi-Key).
Stock showing is not exactly matching suppliers website quantities, could you explain why?

Thank you!
Francois
Stock.xlsx

andres

unread,
Aug 1, 2013, 11:32:59 PM8/1/13
to octopa...@googlegroups.com
Hi Francois,

We receive daily (sometimes twice-daily) feeds from all the major distributors and the 'in_stock_quantity' value is the quantity as last reported by each distributor. If you'd like to see how recent the data is you can access the 'last_updated' timestamp attached to each offer:


Andres

Francois De La Roche

unread,
Aug 2, 2013, 2:08:42 AM8/2/13
to octopa...@googlegroups.com
Hi Andres,

I see, thanks for the clarification!

Francois
Reply all
Reply to author
Forward
0 new messages