API


The main goal of API is packages search and updates checking.
API doesn't provide all available data that is available in pkgs.org database!
API is available in Gold and Platinum Premium Membership tiers only.

GET https://api.pkgs.org/v1/distributions

Returns a list of all distributions.

Request Example

$ export ACCESS_TOKEN=00000000-00000000-00000000-00000000

$ curl -b "access_token=${ACCESS_TOKEN}" "https://api.pkgs.org/v1/distributions" | jq
        

Response

[
  {
    "id": 51,
    "name": "adelie",
    "version": "1.0"
  },
  {
    "id": 60,
    "name": "almalinux",
    "version": "8"
  },
  {
    "id": 16,
    "name": "alpine",
    "version": "3.14"
  },
  ...
        

GET https://api.pkgs.org/v1/repositories

Returns a list of all repositories.

Request Example

$ export ACCESS_TOKEN=00000000-00000000-00000000-00000000

$ curl -b "access_token=${ACCESS_TOKEN}" "https://api.pkgs.org/v1/repositories" | jq
        

Response

[
  {
    "id": 4267,
    "distribution_id": 10,
    "name": "alpine-community-aarch64",
    "architecture": "aarch64",
    "official": true
  },
  {
    "id": 4265,
    "distribution_id": 10,
    "name": "alpine-community-x86_64",
    "architecture": "x86_64",
    "official": true
  },
  {
    "id": 5033,
    "distribution_id": 16,
    "name": "alpine-main-x86_64",
    "architecture": "x86_64",
    "official": true
  },
  ...
        

GET https://api.pkgs.org/v1/packages?repository_id=repository_id

Returns a list of all packages owned by the repository.

Request Parameters

Parameter Mandatory Type Description
repository_id True Integer Repository Id

Request Example

$ export ACCESS_TOKEN=00000000-00000000-00000000-00000000

$ curl -b "access_token=${ACCESS_TOKEN}" "https://api.pkgs.org/v1/packages?repository_id=4813" | jq
        

Response

[
  {
    "filename": "ModemManager-1.10.8-4.el8.x86_64.rpm",
    "filename_src": "ModemManager-1.10.8-4.el8.src.rpm",
    "name": "ModemManager",
    "epoch": null,
    "version": "1.10.8",
    "release": "4.el8",
    "architecture": "x86_64",
    "url_binary": "https://repo.almalinux.org/almalinux/8/BaseOS/x86_64/os/Packages/ModemManager-1.10.8-4.el8.x86_64.rpm",
    "url_source": "https://repo.almalinux.org/almalinux/8/BaseOS/Source/Packages/ModemManager-1.10.8-4.el8.src.rpm"
  },
  {
    "filename": "NetworkManager-1.32.10-4.el8.x86_64.rpm",
    "filename_src": "NetworkManager-1.32.10-4.el8.src.rpm",
    "name": "NetworkManager",
    "epoch": 1,
    "version": "1.32.10",
    "release": "4.el8",
    "architecture": "x86_64",
    "url_binary": "https://repo.almalinux.org/almalinux/8/BaseOS/x86_64/os/Packages/NetworkManager-1.32.10-4.el8.x86_64.rpm",
    "url_source": "https://repo.almalinux.org/almalinux/8/BaseOS/Source/Packages/NetworkManager-1.32.10-4.el8.src.rpm"
  },
  {
    "filename": "bash-4.4.20-2.el8.x86_64.rpm",
    "filename_src": "bash-4.4.20-2.el8.src.rpm",
    "name": "bash",
    "epoch": null,
    "version": "4.4.20",
    "release": "2.el8",
    "architecture": "x86_64",
    "url_binary": "https://repo.almalinux.org/almalinux/8/BaseOS/x86_64/os/Packages/bash-4.4.20-2.el8.x86_64.rpm",
    "url_source": "https://repo.almalinux.org/almalinux/8/BaseOS/Source/Packages/bash-4.4.20-2.el8.src.rpm"
  },
  ...
        

GET https://api.pkgs.org/v1/search?query=query

Searches for packages and returns a list of found packages.

Request Parameters

Parameter Mandatory Type Description
query True String Search query
search_on False String Valid values:
  • name_or_provides - search for packages with specified name or if they provide specified dependency
  • provides - search for packages that provide specified dependency
  • requires - search for packages that require specified dependency
  • files - search for packages that have specified files or directories
Default value: name_or_provides
architecture False String Filters packages by architecture.
Valid values:
  • arm - aarch64, aarch64_cortex-a72, arm64, all, noarch
  • intel - amd64, x86_64, all, noarch
distributions False Array of Integer Filters packages by distribution_id.
Example: 123,456,789
repositories False Array of Integer Filters packages by repository_id.
Example: 987,654.
official False Boolean Filters packages by repository type.
Valid values:
  • true - official repositories
  • false - thirdparty repositories

Request Examples

$ export ACCESS_TOKEN=00000000-00000000-00000000-00000000

$ curl -b "access_token=${ACCESS_TOKEN}" "https://api.pkgs.org/v1/search?query=bash" | jq
$ curl -b "access_token=${ACCESS_TOKEN}" "https://api.pkgs.org/v1/search?query=bash&distributions=16" | jq
$ curl -b "access_token=${ACCESS_TOKEN}" "https://api.pkgs.org/v1/search?query=bash&repositories=3181,5032&architecture=arm&official=true" | jq
$ curl -b "access_token=${ACCESS_TOKEN}" "https://api.pkgs.org/v1/search?query=libcrypt.so.1()(64bit)&search_on=provides" | jq
$ curl -b "access_token=${ACCESS_TOKEN}" "https://api.pkgs.org/v1/search?query=libldap-2.4.so.2&search_on=requires" | jq
$ curl -b "access_token=${ACCESS_TOKEN}" "https://api.pkgs.org/v1/search?query=/usr/include/libraw/&search_on=files" | jq
$ curl -b "access_token=${ACCESS_TOKEN}" "https://api.pkgs.org/v1/search?query=/usr/include/libraw/libraw.h&search_on=files" | jq
        

Response

[
  {
    "filename": "bash-4.4.20-2.el8.x86_64.rpm",
    "filename_src": "bash-4.4.20-2.el8.src.rpm",
    "name": "bash",
    "epoch": null,
    "version": "4.4.20",
    "release": "2.el8",
    "architecture": "x86_64",
    "distribution_id": 60,
    "repository_id": 4813,
    "official": true,
    "url_binary": "https://repo.almalinux.org/almalinux/8/BaseOS/x86_64/os/bash-4.4.20-2.el8.x86_64.rpm",
    "url_source": "https://repo.almalinux.org/almalinux/8/BaseOS/Source/Packages/bash-4.4.20-2.el8.src.rpm"
  },
  {
    "filename": "bash_5.1-5_amd64.deb",
    "filename_src": "bash",
    "name": "bash",
    "epoch": null,
    "version": "5.1",
    "release": "5",
    "architecture": "amd64",
    "distribution_id": 88,
    "repository_id": 49,
    "official": true,
    "url_binary": "http://ftp.de.debian.org/debian/pool/main/b/bash/bash_5.1-5_amd64.deb",
    "url_source": null
  },
  {
    "filename": "bash-5.1.8-r0.apk",
    "filename_src": "bash",
    "name": "bash",
    "epoch": null,
    "version": "5.1.8",
    "release": "r0",
    "architecture": "aarch64",
    "distribution_id": 17,
    "repository_id": 5163,
    "official": true,
    "url_binary": "http://dl-cdn.alpinelinux.org/alpine/v3.15/main/aarch64/bash-5.1.8-r0.apk",
    "url_source": null
  },
  ...
        
Search results are limited to 10.000 packages. Use filters to query only needed packages from specified distributions or repositories.

API Response Codes

Code Description
200 OK The request succeeded
400 Bad Request The server could not understand the request due to invalid syntax
401 Unauthorized Client is not authenticated because the access token is invalid or the premium membership is inactive
404 Not Found The server can not find the requested resource
409 Conflict User has exceeded the daily API requests / pageviews limit
429 Too Many Requests User has sent too many requests in one minute
500 Internal Server Error The server has encountered a situation it does not know how to handle