synt-xerror f3667d615e fix link
2026-02-19 02:25:36 -03:00
2026-02-19 02:19:49 -03:00
2026-02-19 02:21:09 -03:00
2026-02-16 20:34:40 -03:00
2026-02-19 02:25:36 -03:00
2026-02-19 02:21:09 -03:00

Neocities C API

Minimal, secure C wrapper for the Neocities API using API key authentication.

No login flow. No credential storage. Stateless by design.

Users must generate their own API key via the Neocities dashboard.


Features

  • Site info retrieval
  • File listing
  • Upload files
  • Delete files
  • TLS verification enabled by default

Authentication is performed exclusively via:

Authorization: Bearer <API_KEY>

Requirements

  • libcurl

Linux (example):

sudo apt install libcurl4-openssl-dev

Authentication

Generate your API key at:

Neocities > Settings > Manage Site Settings > API (or https://neocities.org/settings/YOUR-USERNAME#api_key)

If you're coding a CLI or application, you must provide the key at runtime (env var, config file, etc).


API Overview

Info (public)

int neocities_info(const char *sitename, char **out);

Fetch metadata about a site.


List files

int neocities_list(const char *api_key, const char *path, char** out);

List files at a path.


Upload

int neocities_upload(const char *api_key, const char **local_files, const char **remote_names, size_t count, char **response);

Uploads multiple files.

  • local_files[i] → local path
  • remote_names[i] → remote filename

Delete

int neocities_delete(const char *api_key, const char **filenames, size_t count, char **response);

Deletes files from the site.


API Key

For security reasons, you should get the API key via Neocities settings. This function is not avaiable.


Example Usage

See [example.c]


Security Notes

  • TLS verification is enforced
  • Redirects are disabled intentionally
  • API key is never persisted internally

Recommended:

  • Store key in env vars
  • Avoid hardcoding

Design Philosophy

  • No login/password support
  • API key only
  • Explicit memory ownership
  • Minimal abstraction

License

MIT

Description
No description provided
Readme 93 KiB
Languages
C 97.8%
Makefile 2.2%