Fetch Category

81 views
Skip to first unread message

gau...@berkeley.edu

unread,
Sep 5, 2018, 10:43:24 AM9/5/18
to Octopart API
Is there a way to fetch the subcategory of a searched part?

For example, if we search 'ATMEGA48-20AU', we should be able to fetch 'Embedded Processors and Controller' within 'ICs'.

Thanks!

ji...@octopart.com

unread,
Sep 5, 2018, 10:48:16 AM9/5/18
to Octopart API
Hi, there is a way to fetch the associated categories of a part.

Category information is contained in a field called `category_uids`, a field that is hidden by default to put a cap on the data we are sending over the wire. You can see us describe this field in the Part schema docs: https://octopart.com/api/docs/v3/rest-api#object-schemas-part

To make this field available, use the include directive `include[]=category_uids`. You can read more about include directives here: https://octopart.com/api/docs/v3/rest-api#include-directives

You will get back an array of uids comprising the category tree, sorted from left to right with parent nodes (e.g. 'ICs') at the left and leaf nodes (e.g. 'Embedded Processors and Controllers') at the right.

Best of luck!
Jimmy
Reply all
Reply to author
Forward
0 new messages