PlatformIO Community

Get library data

Hey I am writing a platformIO wrapper for neovim.
I wanted to ask is there a way to get data for all the library available in josn format like you get data for all available board by using the command pio pkg --json-output

You mean you want to retrieve all existing libraries in the PlatformIO registry (https://registry.platformio.org/)? Which are like… a lot?

Or the ones installed in the project?

Yeah I wanted to retrieve all existing libraries, but now it sounds stupid. Do you know how to get the data in json by giving a search query, like I want output of this pio pkg search in json

See core code.

Example:

curl 'https://api.registry.platformio.org/v3/search?query="ArduinoJson"&page=1&limit=1'
{
  "page": 1,
  "limit": 1,
  "total": 145,
  "items": [
    {
      "id": 64,
      "type": "library",
      "tier": "community",
      "owner": {
        "username": "bblanchon"
      },
      "name": "ArduinoJson",
      "description": "A simple and efficient JSON library for embedded C++. ArduinoJson supports ✔ serialization, ✔ deserialization, ✔ MessagePack, ✔ fixed allocation, ✔ zero-copy, ✔ streams, ✔ filtering, and more. It is the most popular Arduino library on GitHub ❤❤❤❤❤. Check out arduinojson.org for a comprehensive documentation.",
      "keywords": [
        "json",
        "rest",
        "http",
        "web"
      ],
      "license": "MIT",
      "updated_at": "2022-04-05T17:41:31Z",
      "stars_count": 5656,
      "popularity_rank": 3,
      "popularity_trend": -1,
      "version": {
        "id": 43399,
        "name": "6.19.4",
        "unpacked_size": 395536,
        "released_at": "2022-04-05T08:53:11Z",
        "files": [
          {
            "name": "ArduinoJson-6.19.4.tar.gz",
            "size": 87187,
            "checksum": {
              "sha256": "88fd7a943529d4ceb1106addcba04660e61bce65670237226212da5fa82dedd3"
            },
            "system": "*",
            "download_url": "https://dl.registry.platformio.org/download/bblanchon/library/ArduinoJson/6.19.4/ArduinoJson-6.19.4.tar.gz"
          }
        ]
      }
    }
  ]
}

(The output is paginated with a limit of 50 max items for each page).

that would be enough, thanks a lot :slight_smile: