Octopart API endpoint 'search': Getting incorrect MPN's back after searching with MPN

253 views
Skip to first unread message

Bobby Jurriaans

unread,
May 3, 2016, 5:16:19 AM5/3/16
to Octopart API
Hi,

I'm searching for offers through your search API endpoint based on MPN. In my Java webapplication, I'm sending the following request to Octopart (with MPN MBRA340T3G as example):

https://octopart.com/api/v3/parts/search?apikey=XXXX&mpn=MBRA340T3G&filter[fields][offers.seller.name][]=Farnell&filter[fields][offers.seller.name][]=Digi-Key&filter[fields][offers.seller.name][]=Mouser&filter[fields][offers.seller.name][]=RS%20Components&sortby=avg_price%20asc&pretty_print=true&include=specs&limit=50

With this MPN (and every other MPN I try to search with), I'm getting 50 parts back, all with incorrect MPN's, such as 'WPLCC068-1PTRC' and 'GRM033B11A222KA01D'.
I can't find what I'm doing wrong. Is there something wrong with my request?

Thanks,
Bobby Jurriaans

Andres Morey

unread,
May 13, 2016, 11:56:00 AM5/13/16
to octopa...@googlegroups.com
Hi Bobby,

The /parts/search endpoint doesn't support an `mpn` url argument. If you'd like to add an MPN filter to your query you can add `filter[fields][mpn][]=MBRA340T3G` as a url argument.

Alternatively if your queries are limited to MPNs, SKUs and distributors you can use the /parts/match endpoint which is optimized for part number lookups:

Hope that helps! Let me know if you have any other questions.

Andres Morey
Octopart


--

---
You received this message because you are subscribed to the Google Groups "Octopart API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to octopart-api...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages