Giter Club home page Giter Club logo

Comments (9)

Bouni avatar Bouni commented on September 24, 2024 3

I think I've found something really helpful!

A get request to https://cart.jlcpcb.com/shoppingCart/smtGood/getComponentDetail?componentCode=C2286

Gives back a nice JSON object with all sorts of helpful data.

  • "leastNumber":20,
  • "leastNumberPrice":0.1520,
  • "stockCount":399792,

Here's the full response:

{
   "code":200,
   "data":{
      "assemblyMode":"smtWeld",
      "assemblyProcess":"SMT",
      "attributes":[
         {
            "attribute_name_en":"Illumination Color",
            "attribute_value_name":"Red"
         },
         {
            "attribute_name_en":"Dominant Wavelength / Coordinate rank",
            "attribute_value_name":"615~630nm"
         },
         {
            "attribute_name_en":"Luminous Intensity (IF=20mA)",
            "attribute_value_name":"100~120mcd"
         },
         {
            "attribute_name_en":"Correlated Color Temperature - CCT(K)",
            "attribute_value_name":"-"
         },
         {
            "attribute_name_en":"Mounting Type",
            "attribute_value_name":"Surface Mount"
         },
         {
            "attribute_name_en":"Lens Color",
            "attribute_value_name":"-"
         },
         {
            "attribute_name_en":"Luminous Flux/Radiant Flux",
            "attribute_value_name":"-"
         },
         {
            "attribute_name_en":"Color Rendering Index(CRI)",
            "attribute_value_name":"-"
         },
         {
            "attribute_name_en":"Vf - Forward Voltage",
            "attribute_value_name":"1.9~2.2V"
         },
         {
            "attribute_name_en":"Size / Dimension",
            "attribute_value_name":"1.6mm x 0.8mm"
         },
         {
            "attribute_name_en":"Height (Max)",
            "attribute_value_name":"0.7mm"
         },
         {
            "attribute_name_en":"Operating Temperature",
            "attribute_value_name":"-40℃ ~ +85℃"
         }
      ],
      "canPresaleNumber":290199,
      "componentBrandEn":"Hubei KENTO Elec",
      "componentCode":"C2286",
      "componentDesignator":"D",
      "componentImageUrl":"https://assets.lcsc.com/images/lcsc/900x900/20180914_Hubei-KENTO-Elec-KT-0603R_C2286_front_10.jpg",
      "componentLibraryType":"base",
      "componentModelEn":"KT-0603R",
      "componentName":"Hubei KENTO Elec KT-0603R",
      "componentPresaleType":"buy",
      "componentSource":"jlc",
      "componentSpecificationEn":"LED_0603",
      "componentStatus":"yes",
      "componentTypeEn":null,
      "dataManualUrl":"https://datasheet.lcsc.com/lcsc/1810231112_Hubei-KENTO-Elec-KT-0603R_C2286.pdf",
      "describe":"Red 615~630nm 1.9~2.2V 0603 Light Emitting Diodes (LED) RoHS",
      "encapsulationNumber":4000,
      "encapsulationUnit":"PCS",
      "erpComponentName":"LED_灯_红_Iv=100-120_λd=615-630",
      "firstTypeNameEn":"Optocouplers & LEDs & Infrared",
      "initialPrice":0.0030,
      "jlcPrices":[
         {
            "componentCode":"C2286",
            "createTime":null,
            "deleted":false,
            "endNumber":199,
            "jlcComponentPriceAccessId":null,
            "jlcComponentPriceKeyId":null,
            "lcscComponentId":null,
            "productPrice":0.0076,
            "startNumber":1,
            "updateTime":null
         },
         {
            "componentCode":"C2286",
            "createTime":null,
            "deleted":false,
            "endNumber":-1,
            "jlcComponentPriceAccessId":null,
            "jlcComponentPriceKeyId":null,
            "lcscComponentId":null,
            "productPrice":0.0030,
            "startNumber":200,
            "updateTime":null
         }
      ],
      "lcscComponentId":2659,
      "lcscGoodsUrl":"https://lcsc.com/product-detail/Light-Emitting-Diodes-LED_Hubei-KENTO-Elec-KT-0603R_C2286.html/?href=jlc-SMT/?href=jlc-SMT",
      "leastNumber":20,
      "leastNumberPrice":0.1520,
      "lossNumber":5,
      "matchedPartDetail":"Hubei KENTO ElecRed 615~630nm 1.9~2.2V 0603 Light Emitting Diodes (LED) RoHS",
      "minImage":"https://assets.lcsc.com/images/lcsc/96x96/20180914_Hubei-KENTO-Elec-KT-0603R_C2286_front_10.jpg",
      "minPresaleNumber":4000,
      "minPresalePrice":null,
      "minPurchaseNum":4000,
      "overseasStockCount":399792,
      "preMinPurchaseNum":null,
      "prices":null,
      "secondTypeNameEn":"Light Emitting Diodes (LED)",
      "stockCount":399792,
      "storyGoods":true,
      "warehouseCode":"sz",
      "warehouseName":"深圳"
   },
   "message":null
}

from kicad-jlcpcb-tools.

Bouni avatar Bouni commented on September 24, 2024 2

We could also calculate the cost for the SMT assembly:

image

The number of solder joints is available from the database 😀

from kicad-jlcpcb-tools.

Bouni avatar Bouni commented on September 24, 2024

Maybe this gets solved with #55

from kicad-jlcpcb-tools.

Bouni avatar Bouni commented on September 24, 2024

I implemented the use of the API and it works but does not line up with what JLC's Website calculates for some reason:

Dummy PCB, 1 LED (C2286), 40 Resistors (C25804)

image

The leastnumber for both is 20 so the led gets the leastprice of 0.152, the resistors the regular price of 0.0025
5 Assembled PCBs should calculate like this:
1x 0.152 + 40x 0.0025 = 0.152 + 0.1 = 0.252 x 5 = 1.26

image

But JLC's Website gives me totally wrong number for the parts count and a much lower parts cost for some unknown reason:

image

20x LED seems ok, because thats the least number and the price of 0.152 fits also
206x Resistor does not fit at all, we have just 200 Resistors, but their price for the 206 fits with 0.5150

from kicad-jlcpcb-tools.

Bouni avatar Bouni commented on September 24, 2024

Oh man, it just made click!

I cannot simply multiply the price for one pcb by 5 because the leastnumber for the led is 20 which is < the led count on 5 PCBs so we get the leastprice just once and not 5 times 🤦🏽‍♂️

What do you guys mean, should we always calculate the price for 5 assembled pcbs to get a correct sum?

Edit:
I did just that and the price lines up with the website (if they fix their part count issue):
image

from kicad-jlcpcb-tools.

arturo182 avatar arturo182 commented on September 24, 2024

It makes sense to calculate for the 5PCBs since you can't order fewer, but then you can also present that number divided by 5 to show how much it's per board.

from kicad-jlcpcb-tools.

Bouni avatar Bouni commented on September 24, 2024

@arturo182 Indeed, that sound right!

I've implemented the solderjoint x partcount x 0.0015 x 5 calculation as well, but again, I get a different result that is correct in my eyes 😕

image

LED: 2 x 1 x 0.0015 = 0.003 x 5 = 0.015
Resistors: 2 x 40 x 0.0015 = 0.12 x 5 = 0.60

I guess the calculate the assembly fee even if the parts are not populated.
20 LEDs are charged, but just 5 are really mounted, so I guess thats where the difference comes from ...

from kicad-jlcpcb-tools.

arturo182 avatar arturo182 commented on September 24, 2024

Ouch, so you're paying them for throwing out the extra LEDs 😅

from kicad-jlcpcb-tools.

Bouni avatar Bouni commented on September 24, 2024

I'll close this for now as its unrealistic to get this right without proper API access.

from kicad-jlcpcb-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.