Use Partinfo API
See original GitHub issueAs I mentioned on the forum I’d be happy for KiCost users to make use of the Partinfo API.
I am happy for people working on BOM tools, especially KiCost users and developers, to use (but not abuse) the Partinfo endpoint right now, specifically: https://dev-partinfo.kitspace.org/graphql.
It’s currently an open endpoint so anyone can access it. Docs are a bit thin but you are able to browse the schema using the “Documentation Explorer” on the right on the above URL and you can jump on our chat or the GitHub issue tracker if you have any questions. You don’t need any special GraphQL client to use it, here is the example query using curl:
curl -H 'Content-Type: application/json' -X POST -d '{"query": "{ part(mpn: {part: \"NE555P\", manufacturer: \"Texas Instruments\"}) { datasheet description type offers { sku { vendor part } prices { USD EUR GBP SGD } } } }"}' https://dev-partinfo.kitspace.org/graphql | python -m json.tool
To cover the API costs when Octopart does ask for payment I suggest we pool money in opencollective.com/kitspace. I estimate that $100 a month will be enough to cover current KiCost users (but we will see of course).
Some more explanation of the current Partinfo schema.
Currently there are 3 query types and all of the return Part
types. As with the Octopart API the Part
types contains an array of Offer
types from different retailers with prices. E.g.
part(mpn: Mpn, sku: Sku): Part
Returns a single Part
that matches a manufacturer part number (Mpn
) or retailer stock keeping unit (Sku
). This is considered a match. You can also batch multiple part matches requests and get back multiple parts.
match(parts: [MpnOrSku]): [Part]
We can also search and get back multiple parts.
search(term: String): [Part]
Here free form text is parsed by Electro Grammar and turned into parametric Octopart searches and also matched against the Common Parts Library.
Issue Analytics
- State:
- Created 5 years ago
- Comments:70 (63 by maintainers)
Top GitHub Comments
@kasbah, KiCost with PartInfo API is released https://forum.kicad.info/t/new-kicost-release/8074/2 Please, keep us updated about the server use and some statistics (for example country of access, …). If necessary, we can add a “&tool=kicost” in the request link to help you with the statistics.
OK, once @hildogjr has a new release of KiCost on PyPI, then we can announce it has re-awakened and it is using Partinfo as its engine. Then we can request donations for Partinfo’s upkeep. (If we get more than $100, I’d be very surprised.)
@hildogjr , with regards to creating new API interfaces and scraping modules for KiCost, I think your effort would be better spent doing that inside the Partinfo framework. That way, the new interfaces will be available to any and all tools that use Partinfo. That may lead to more maintainers and quicker bug fixes, particularly for any web scrapers.