API Info

This website (hb-app.store) is a web frontend to access the packages in our repositories. Both the console app and this site are open-source clients that access these repos using our API.

The two main repositories used by this project are:

A repository is a JSON file that contains a list of all the packages in the repository, along with their metadata. The repo content is updated by our build script whenever 4TU staff adds or updates the contents of a package.

When changes are made to the repos, a message is posted in #hbas-updates on our Discord. The build script used to accomplish this is libget's repogen.py, which turns a locally maintained directory of files for each package into compressed zip files and a repo.json file.

The below commands use curl and jq to parse the JSON output. If you don't have these installed, you can any HTTP client and JSON parser of your choice.

Target Repo for Examples:  

Listing all packages

Package metadata is stored in an array underneath the root-level packages key.
curl https://wiiu.cdn.fortheusers.org/repo.json | jq '.packages'
Response:
[]

Listing packages from a specific author

The packages array can be filtered by any of its attributes. The below example uses jq to filter the array by author.
curl https://wiiu.cdn.fortheusers.org/repo.json | jq '.packages | map(select(.author == "vgmoose"))'
Response:
[]

Listing all packages in a category

Likewise, a category can be used to filter the array. The below example uses jq to filter the array by category.
curl https://wiiu.cdn.fortheusers.org/repo.json | jq '.packages | map(select(.category == "game"))'
Response:
[]
Target Package for Examples:  

Getting info on a single package

Every package in the array has a unique name attribute that identifies it. This short name is used to track updates to the package, and will not change even if the package's title or other metadata changes.

There's no specific API endpoint to get a single package, so the array needs to be searched for the package with the matching name.
curl https://wiiu.cdn.fortheusers.org/repo.json | jq '.packages | map(select(.name == "vgedit"))[0]'
Response:
{}

Downloading a specific package

From inspecting the metadata, once you know the name of a package, you can download it at /zips/[name].zip.

This URL can also be directly visited in a browser to download the package.
curl -O https://wiiu.cdn.fortheusers.org/zips/vgedit.zip
Response: [name].zip in the current directory. There are no restrictions on how often a package can be downloaded, but please be considerate of our bandwidth. If the service is abused, we may implement rate limiting.

Getting package image assets

Using the package name again, URLs for the package's icon and banner can be constructed, and viewed or downloaded.
curl -O https://wiiu.cdn.fortheusers.org/packages/vgedit/icon.png
Response:
example icon

The banner is a wide image that is displayed on the package's details page, but for historical reasons it's named screen.png.
curl -O https://wiiu.cdn.fortheusers.org/packages/vgedit/screen.png
Response:
example banner

Downloading all screenshots for a package

The total number of available screenshots is listed in the package metadata under the screens attribute. First we'll get this count and store it in an env variable:
export SCREENS_COUNT=$(curl https://wiiu.cdn.fortheusers.org/repo.json | jq '.packages | map(select(.name == "vgedit"))[0].screens')
Then we can use a bash expansion to download all the screenshots at once:
curl --remote-name-all https://wiiu.cdn.fortheusers.org/packages/vgedit/screen{1..$SCREENS_COUNT}.png
Response:

If you have any questions about these responses or the usage of this API, please contact us on Discord. If you are using our repos for a project, we would love to hear about it!

For additional information on the structure of the packages, see the libget wiki. The info there lines up with the above, but it also details Manifests, which are used by some packages to instruct the console app on how to handle certain files within a package during an update.

The libget wiki also goes over an easy way to generate and maintain your a repo, using pkgbuild.json files and Spinarak. This can be convenient for self-hosting your own packages and managing updates directly to users. However, this use case is uncommon and most hb-appstore users don't add and track external repos at this time.