pixqc / ziglist

Discover Zig projects and packages
https://ziglist.org
MIT License
36 stars 0 forks source link

REST API #4

Open edqx opened 1 month ago

edqx commented 1 month ago

It would be quite helpful to many people to make use of a public REST API for Ziglist, so that people can make their own applications that make use of the knowledge available. For example, someone's package manager CLI could make use of the directory, or someone could make a CLI for Ziglist, or a discord bot, etc.

Here's some example endpoints I had in mind:

# get basic statistics about the repository, i.e. package counts
GET /

# get front-page packages
GET /packages?sort=active
GET /packages?sort=new
GET /packages?sort=top

# get package dependencies
GET /deps

# search packages
GET /packages?q=http
GET /packages?q=websocket

# get a specific package by its 'name' on ziglist
GET /packages/karlseguin/http.zig
pixqc commented 1 month ago

Unless there's strong demands, I don't think an API makes sense.

If people want the data Ziglist has, they can:

I think these three solutions work fine for most cases without the overhead of designing+maintaining API endpoints.