Parts/match query response always limited to 3

159 views
Skip to first unread message

Fulvio

unread,
Jan 26, 2018, 3:29:26 PM1/26/18
to Octopart API
Dear all,

I've just found Octopart API and started playing around.
I have a problem with the number of results found for a Partsmatch query: whatever limit I set, I always get 3 results only.

This is my sample query:

And this is the first part of the response's body:

{
  "__class__": "PartsMatchResponse",
  "msec": 70,
  "request": {
    "__class__": "PartsMatchRequest",
    "exact_only": false,
    "queries": [
      {
        "__class__": "PartsMatchQuery",
        "brand": null,
        "limit": 3,
        "mpn": "INA225*",
        "mpn_or_sku": null,
        "q": "",
        "reference": null,
        "seller": null,
        "sku": null,
        "start": 0
      }
    ]
  },
  "results": [
    {
      "__class__": "PartsMatchResult",
      "error": null,
      "hits": 4,
      "items": [

Is my query correct? Why I get only 3 results (even if I change the PN searched and I get dozen or hundreds of hits, the results found are always 3!).

Thanks,

Fulvio

ji...@octopart.com

unread,
Jan 26, 2018, 3:34:23 PM1/26/18
to Octopart API
Hi Fulvio,

Your query is only slightly off. When specifying limit you should do it within the query json
{"mpn":"INA225*","limit":4}

rather than as an additional URL parameter
&limit=4

It can be kind of easy to slip up on syntax like this.

Here's an example where this works in practice!
(remember to enter  APIKEY)
https://octopart.com/api/v3/parts/match?apikey=APIKEY&queries=[{%22mpn%22:%22INA225*%22,%22limit%22:4}]&pretty_print=true

Let me know if you have any additional questions!

Jimmy
Octopart
Reply all
Reply to author
Forward
0 new messages