Building Apps with the Octopart API
Pulse
Octopart Staff
Apr 4, 2021

We love seeing people sign up for the new API to build apps for sourcing and manufacturing. We estimate that about 45% of our existing API users are software developers that find Octopart data useful for ERP, PLM, and other design tools.

If you are on a development team and are trying to build similar front end functionality, as our search engine provides, you might find the below example query helpful.

“Pro Tip:” The filters and modals you see on a Search Results page are actually added after your query results return from a basic API search. You can develop the same front end functionality on your own just by starting with the Octopart API.

query MyPartSearch {
  search(q: "msp430") {
    total

    manufacturer_agg {
      company {
        id
        name
      }
      count
    }

    results {
      part {
        id
        manufacturer {
          name
        }
        mpn
      }
    }
  }
}

One of the most useful part attributes developers want to retrieve is the lifecycle status of a particular part found on our website.

“Pro Tip 2:” To get Lifecycle Status of a part, you can use the below query that pulls up specs.

query {
search(q: "BAV99,215", limit: 1) {
results {
part {
mpn
manufacturer {
name
}
best_datasheet {
name
url
credit_string
credit_url
page_count
mime_type
}
specs {
attribute 
name
group
}
display_value
}
document_collections {
name
documents {
name
url
credit_string
credit_url
}
}
}
}
}
}

As you can see in the below results from the example query, the Supply Chain results revealed in the API Playground match the results found on Octopart.com for MPN BAV99,215

Persona 3bPersona 3c

If you would like to practice the query above, paste it into the GraphQL Playground and customize it with the MPN of your choice. You will find further resources, such as documentation, that you can easily reference from the side panel. This should guide you and your team as you customize your query with different part specifications.

Persona 3d

The documentation found on the Playground reflects the API Documentation page for part attributes.

Persona 3e

If you are looking to access more parts (or data sets) returned with your token, you can revisit the registration page and click Manage Plan to upgrade your plan.

Persona 1e and 3f

We hope you found this information helpful. If you need assistance managing your plan or have questions about our documentation, please contact us at api@octopart.com.

Read More Articles