Octopart in Excel

excel-2007-logo We've got some great news for folks who maintain their BOMs in Excel!

Now you can easily pull pricing, availability, "Buy Now" URLs, datasheet URLs, and more right into your spreadsheet with a few simple functions.

All you need are three things. Well, four things, counting Excel for Windows:

  1. An Octopart API key (click "Register an application" to get one)
  2. The DataNitro plugin for Excel
  3. This handy Python file of Octopart functions (Right click, "Save as")

The first thing you need to do is download and install DataNitro into Excel. DataNitro is a plugin that allows you to use Python functions within Excel. The installation is a very straightforward process. After it's installed, you'll see a new DataNitro tab in Excel.

Next, you'll need to get your Octopart API key and enter it as the MY_API_KEY value in the functions.py file you downloaded. The file can be opened in any text editor.


Finally, open the BOM you're working on, select the DataNitro tab, and click on "Import" to import the Python Octopart functions file you downloaded.


You're now ready to use Octopart functions directly in your BOM spreadsheet! Here's a list of the available Excel functions (note: manufacturer name is optional):

  • =OCTOPART_URL(mpn_or_sku, [manufacturer]) Returns the URL for the part's detail page on Octopart when given a part number
  • =DATASHEET_URL(mpn_or_sku, [manufacturer) Returns the part's datasheet URL when given a part number
  • =DISTY_STOCK(distributor, mpn_or_sku, [manufacturer]) Returns a distributor's stock quantity. Distributor name must match exactly from this list.
  • =DISTY_PRICE(distributor, mpn_or_sku, [manufacturer]) Returns a distributor's price. Distributor name must match exactly from this list.
  • =DISTY_URL(distributor, mpn_or_sku, [manufacturer]) Returns the URL you can use to buy the part from the distributor. Distributor name must match exactly from this list.

Here's a screenshot of a few functions in action:


If you know the Python programming language, you can further customize the functions.py file and add other functions, too.

Let us know if you have any issues or questions, and we'll do our best to help you out!

To get more interesting product developments and API examples like this, sign up for our newsletter.