GraphQL API
The Zenode GraphQL API gives you precise control over the data you fetch — request only the fields you need. It exposes the same part search capabilities as the REST API, and adds aggregations and BOM matching in a single request.
Endpoint
POST https://api.zenode.ai/graphqlAll requests are POST with a JSON body containing query and optionally variables.
Interactive explorer
An interactive GraphiQL explorer is available at api.zenode.ai/graphql. You can browse the schema, autocomplete fields, and run queries directly in the browser — no setup required.
Authentication
Include your API key as a Bearer token on every request:
curl -X POST https://api.zenode.ai/graphql \
-H "Authorization: Bearer zn_your_api_key" \
-H "Content-Type: application/json" \
-d '{"query": "{ supSearchMpn(mpn: \"LM358\", limit: 3) { hits } }"}'See the Authentication guide for how to create a key.
MPN search
Use supSearchMpn when you have an exact or partial manufacturer part number:
{
supSearchMpn(mpn: "LM358", limit: 5) {
hits
warnings
results {
description
part {
mpn
shortDescription
manufacturer {
name
slug
}
}
}
}
}hits is the count of results returned in this page. warnings is a list of human-readable strings describing any ignored or partially-supported parameters.
Keyword search
Use supSearch for natural-language or keyword queries:
{
supSearch(q: "5V LDO regulator", start: 0, limit: 10) {
hits
results {
part {
mpn
slug
sellers {
company {
name
}
}
}
}
}
}Both supSearchMpn and supSearch accept the same arguments:
| Argument | Type | Default | Description |
|---|---|---|---|
mpn / q | String | — | Search input |
start | Int | 0 | Offset for pagination |
limit | Int | 10 | Page size (1–100) |
inStockOnly | Boolean | false | Only return parts with available stock |
hasDatasheetOnly | Boolean | false | Only return parts with a datasheet |
filters | JSON | null | Filter map (manufacturer ID, distributor ID, attribute shortname, etc.) |
country | String | "US" | Country context for pricing |
currency | String | "USD" | Currency for pricing |
distributorApi | Boolean | false | Request live distributor pricing and stock |
Aggregations
Aggregations run on the result set and are requested as resolver fields directly on the query result. You can ask for manufacturer buckets, category buckets, and spec value distributions in the same request:
{
supSearch(q: "op-amp", limit: 20) {
hits
manufacturerAgg(size: 10) {
count
company {
name
}
}
categoryAgg(size: 5) {
count
category {
name
}
}
specAggs(
attributeNames: ["Supply Voltage", "Package Type"]
specAggSize: 10
) {
attribute {
name
shortname
}
buckets {
displayValue
count
}
}
}
}Aggregations are only on search queries
manufacturerAgg, categoryAgg, and specAggs are resolver fields on SupPartResultSet — they are only available on supSearchMpn and supSearch results, not on supParts.
BOM matching
supMultiMatch lets you match many BOM lines in one request. Each entry in queries can be identified by mpn, sku, or mpnOrSku, with an optional reference string that is echoed back on the result:
{
supMultiMatch(
queries: [
{ mpn: "LM358", start: 0, limit: 3, reference: "U1" }
{ mpn: "STM32F405RGT6", start: 0, limit: 3, reference: "U2" }
{ mpnOrSku: "C14663", start: 0, limit: 3, reference: "C1" }
]
) {
reference
hits
parts {
mpn
manufacturer {
name
}
}
errorString
}
}Search priority per line: mpn → sku → mpnOrSku. errorString is set when a line is invalid (e.g. all three fields are empty). At most 50 queries per request.
You can pass options to filter results across all lines:
{
supMultiMatch(
queries: [{ mpn: "LM358", start: 0, limit: 5 }]
options: { requireStockAvailable: true }
) {
reference
hits
parts { mpn }
}
}Other queries
Get parts by ID
{
supParts(ids: ["12345", "67890"]) {
id
mpn
manufacturer {
name
}
}
}List manufacturers
{
supManufacturers(slugs: ["texas-instruments"]) {
id
name
slug
homepageUrl
}
}Omit both ids and slugs to fetch all manufacturers. When both are provided, manufacturers matching either filter are returned.
List categories
{
supCategories(root: ELECTRONIC_PARTS) {
id
name
path
numParts
}
}REST vs GraphQL
| Use case | Recommendation |
|---|---|
| Simple MPN or keyword lookup | Either — REST is slightly simpler |
| Need only specific fields | GraphQL — avoids over-fetching |
| Aggregations (manufacturer, category, specs) | GraphQL — not available in REST |
| BOM matching (multiple parts at once) | GraphQL — supMultiMatch is GraphQL-only |
| Scripting or CLI pipelines | REST — easier with curl and jq |
See the REST API guide and the GraphQL Reference for full schema details.