API documentation

Response example

{
    "version": "2024.03.18",
    "date": "2024-03-18 20:34:02",
    "vendors": [
        {
            "id": "1209",
            "name": "Generic",
            "devices": [
                {
                    "id": "0001",
                    "name": "pid.codes Test PID"
                },
                ...
            ]
        },
        ...
    ]
}

Filters

To get a specific device or list of devices you can add VID and PID filters to the request.
The request can be:

  • a single VID or PID
  • a list of multiple VIDs or PIDs
  • a specific pair of VID and PID

as well as each combination of them.

If the request contains a list of multiple VIDs all PIDs will be filtered independently like a request without VID.

All VIDs and PIDs need to be in HEX format with 4 digits!

GET request

GET request filters are part of the URL. They are specified as query string/parameter.

// single VID/PID
vid=(VID)
pid=(PID)

// list of VIDs/PIDs
vid[]=(VID 1)&vid[]=(VID 2)&...
pid[]=(PID 1)&pid[]=(PID 2)&...

Examples for GET request filters:

// all devices with vendor ID 0x1209
apps.sebastianlang.net/usb-ids?vid=1209

// all devices with product ID 0x0001
apps.sebastianlang.net/usb-ids?pid=0001

// a specific device with VID 0x1209 and PID 0x0001
apps.sebastianlang.net/usb-ids?vid=1209&pid=0001

// two devices (0x0001, 0x0002) from the same vendor 0x1209
apps.sebastianlang.net/usb-ids?vid=1209&pid[]=0001&pid[]=0002

POST request

POST request filters are part of the body data. They need to be in JSON format as single object or list of objects.

// single object
{
    "vid": "(VID)",
    "pid": "(PID)"
}

// list of objects
[
    {
        "vid": "(VID)",
        "pid": "(PID)"
    },
    {
        "vid": "(VID)",
        "pid": [
            "(PID 1)",
            "(PID 2)",
            ...
        ]
    },
    {
        "vid": [
            "(VID 1)",
            "(VID 2)",
            ...
        ]
    },
    ...
]

Examples for POST request filters:

// all devices with vendor ID 0x1209
{
    "vid": "1209"
}

// all devices with product ID 0x0001
{
    "pid": "0001"
}

// a specific device with VID 0x1209 and PID 0x0001
{
    "vid": "1209",
    "pid": "0001"
}

// two devices (0x0001, 0x0002) from the same vendor 0x1209
{
    "vid": "1209",
    "pid": [
        "0001",
        "0002"
    ]
}

// all devices with vendor ID 0x1209 or 0x1234
{
    "vid": [
        "1209",
        "1234"
    ]
}

// multiple filters in one requests
[
    {
        "vid": "1209",
        "pid": "0001"
    },
    {
        "vid": "1234",
        "pid": "0000"
    },
    {
        "vid": [
            "2341",
            "0403"
        ]
    }
]

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert