What Are Part Limits and How Do They Work?

Modified on Fri, 24 Mar 2023 at 04:28 PM

Article Contents

What are Part Limits?


Part limits allow us to control who is using the Nexar API and moderate its usage. Any supply query (prefixed "sup") that returns parts and their data, will count that many parts against your part limit. Design queries (prefixed "des") do not cost anything. It's important to note the difference between a query and a part - if you make 10 queries that each return 100 parts then 1000 parts of your limit will be used up.


Limits are reset monthly on the 1st of each month and there is no rollover of parts that are unused into the next month's limit.


Each of your supply applications will have its own part limit. By default, an application will have a limit of 1000 and would be classed as an evaluation app allowing you to test out the API with all the extra features enabled. With an API plan, you can increase your limit as required.


How do Part Limits Work?


As mentioned before, it's important to make the distinction between an API query and a part that is returned. Your limit is based on the number of parts returned - not how many queries you make. For most queries, the default is to return 10 parts. Below are some example queries and their costs:


Categories Query - Free. No parts are returned in this query so it won't use up any of your limits.

query Categories {
    supCategories {
        id
        name
        path
    }
}



Basic Mpn Search - 10 parts. As mentioned previously, by default 10 parts will be returned.

query MpnSearch {
    supSearchMpn {
        hits
        results {
            part {
                id
                name
                mpn
            }
        }
    }
}



Limited Mpn Search - 3 parts. By setting the "limit" input field you can control how many parts are returned. (Maximum of 100) 

query LimitedMpnSearch {
    supSearchMpn (
        limit: 3
    ){
        hits
        results {
            part {
                id
                name
                mpn
            }
        }
    }
}



Multi Mpn Search - 2 parts. "supMultiMatch" returns 1 part per query as it looks for an exact match. In the query below there are two queries so then overall this query is costing 2 parts.

query MultiSearch {
    supMultiMatch (
        queries: [
            {mpn: "SY55855VKG"},
            {mpn: "SY89832UMG"},
        ]
    ){
        hits
        parts {
            id
            name
            mpn
        }
    }
}


How to check your limits and usage


You can check these in the Nexar portal. 



Alternatively, this data is available via the API. Please note that you will need to have an application with the design scope to make these queries as an access token with the "openid" and "user.access" scopes should be provided. You can generate an access token in the portal or you can fetch them programmatically. Please see our first-design-query example to see how to fetch design tokens programmatically.


Here's an example query:



query PartLimits {
    admOrganizations {
        id
        name
        applications {
            id
            name
            supplyCounts {
                partCounter
                partLimit
            }
        }
    }
}



Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article