On this page

Remote server API

Everything a backend needs to speak CyberFoil's Remote protocol. AeroFoil is the reference server. If your catalog still lives at /api/shop/sections, that path is accepted when /api/remote/sections is missing.

Related: Network & download · Install pipeline · Changelog

Connecting from CyberFoil

Point Settings at a Remote, or drop a profile under sdmc:/switch/CyberFoil/remotes/. Older shops/*.json files migrate on launch.

  • Default HTTP port: 8465 (HTTPS defaults to 443)
  • Example LAN URL: http://192.168.1.2:8465
  • Auth: optional HTTP Basic (remoteUser / remotePass in config, or per-profile)
  • Each profile can store lanUrl, wanUrl (HTTPS), and connection: auto, lan, or wan
  • Trailing slashes are stripped; bare hostnames get a scheme prepended

Remote profile file example:

{
  "remote": {
    "protocol": "http",
    "host": "192.168.1.2",
    "path": "",
    "port": 8465,
    "username": "user",
    "password": "pass",
    "title": "My LAN remote",
    "favourite": false,
    "legacyMode": false,
    "lanUrl": "http://192.168.1.2:8465",
    "wanUrl": "https://remote.example.com",
    "connection": "auto",
    "uid": ""
  }
}

LAN discovery

Settings → Remote → Discover LAN Servers. The client broadcasts on UDP 8465.

  • Request payload: OWNFOIL_DISCOVER
  • Scan lasts about three seconds. B cancels, X scans again. Max 64 replies, 4096 bytes each.
  • Reply fields used by the client: uid, name, version, remote (optional WAN hint), HTTP port, public/private flag. Source IPv4 becomes the LAN address.
  • AeroFoil must enable LAN discovery. Allow UDP 8465. Client isolation, other subnets, and Docker without host networking often block broadcasts.
  • Discovery never writes credentials and does not overwrite an existing WAN URL. A saved uid updates the same profile on the next scan.

How CyberFoil loads a catalog

  1. If remoteLegacyMode is on → GET Remote root only (Tinfoil-style).
  2. Otherwise → GET /api/remote/sections.
  3. On 404 or failure → GET /api/shop/sections.
  4. Still failing → fallback to root GET (legacy JSON or TINFOIL binary).
  5. After load, optional MOTD from root JSON field success (skipped if body is TINFOIL).
  6. Search is client-side only - filters item names in the current section. No search HTTP API.

HTTP endpoints

All catalog requests are GET. File installs use GET on each item's url (with Basic auth forwarded).

MethodPathPurpose
GET/api/remote/sectionsModern catalog (preferred)
GET/api/shop/sectionsSame shape - used if /api/remote/sections is missing
GET/Legacy catalog, MOTD, or TINFOIL payload
GET/api/remote/icon/{TITLEID}Icon - 16 hex digits, uppercase. Falls back to /api/shop/icon/{TITLEID} when that prefix was used
GET{item.url}Download NSP/NSZ/XCI/XCZ for install, or cheat text
GET/api/saves/listRemote save backups (non-legacy mode)
POST/api/saves/upload/{TITLEID}Upload save zip (multipart)
GET/api/saves/download/{TITLEID}.zipDownload latest save
GET/api/saves/download/{TITLEID}/{saveId}.zipDownload specific version
DELETE/api/saves/delete/{TITLEID}Delete save(s) for title
DELETE/api/saves/delete/{TITLEID}/{saveId}Delete one version
POST/api/cheatsUpload cheat text (AeroFoil admin)

Remote fetch: 30s timeout, up to 4 retries on 408/429/5xx. SSL verify is disabled for Remote requests.

Modern response: /api/remote/sections

Content-Type should be JSON. Error object:

{ "error": "Invalid credentials" }

Success shape:

{
  "sections": [
    {
      "id": "base",
      "title": "Games",
      "items": [
        {
          "name": "Example Game",
          "url": "/files/example.nsp",
          "size": 1234567890,
          "title_id": "01007EF00011E000",
          "app_version": 65536,
          "app_type": "base",
          "icon_url": "/api/remote/icon/01007EF00011E000",
          "release_date": 20240115
        }
      ]
    }
  ],
  "success": "Welcome - shown as message of the day"
}

Section id hints used client-side: all, updates/update, dlc, installed (local), saves/save, cheats.

Item fields

FieldAliasesNotes
url-Required for installs and cheat download. Relative paths resolved against Remote base. URL fragment used as display name if name absent.
name-Display title
size-File size in bytes
title_id-16-char hex or decimal
app_id-Used to infer title ID / type when title_id is missing
app_version-Version number
app_type-base, upd/update/patch, dlc/addon, CHEAT, or 0/1/2
icon_urliconUrlIf omitted and title_id set → auto {apiPrefix}/icon/{ID}
release_datereleaseDate, dateInteger YYYYMMDD
build_id-Cheat build ID (hex). Required with title_id for cheat rows

After parsing, CyberFoil may prompt to include related updates and DLC for selected bases. Remote titles are grouped by base / update / DLC.

Cheats (AeroFoil)

Catalog rows in a cheats section, or any item with app_type CHEAT, are not NSP/XCI installs. The client requires a valid title ID and build ID.

{
  "id": "cheats",
  "title": "Cheats",
  "items": [
    {
      "app_type": "CHEAT",
      "title_id": "01007EF00011E000",
      "build_id": "ABCDEF0123456789",
      "title_name": "Example Game",
      "note": "Infinite health",
      "url": "/api/cheats/01007EF00011E000/ABCDEF0123456789"
    }
  ]
}
  • Download: GET item.url - raw cheat text. HTTP 404/405 → “this server does not support the cheat download API”.
  • Install path: atmosphere/contents/<titleId>/cheats/<buildId>.txt
  • Upload: POST /api/cheats multipart title_id, build_id, content, optional note. Needs admin Basic auth. 401/403 = not an admin.
  • Disabled in Tinfoil/legacy mode. remoteHideIncompatibleCheats hides builds that do not match installed titles.

Legacy / Tinfoil mode

Enable remoteLegacyMode in Settings (Tinfoil Mode). Changes client behaviour:

  • Only GET Remote root - no /api/remote/sections
  • User-Agent header is empty
  • Save sync and cheat APIs are disabled
  • Legacy headers report version 20.0.2

Legacy JSON at root

At least one of:

  • sections - same as modern API
  • files / paths - array of objects or map of "Display Name": "path_or_url"
  • directories - URLs fetched recursively for nested manifests

Per-entry URL keys: url, path, file, download_url, downloadUrl, or a plain string.

TINFOIL binary

Body starts with magic TINFOIL (optional BOM/whitespace prefix). May be AES-encrypted and/or zstd/zlib compressed. Decrypts to JSON. Encrypted remotes without the required library blob are rejected with an error.

{
  "files": {
    "Game [01007EF00011E000][base]": "/nsp/game.nsp"
  }
}

Request headers

HTTP Basic

Standard Authorization: Basic … when username or password is configured. Credentials are sent only to the configured server origin.

User-Agent (non-legacy Remote fetch)

httpUserAgentModeSent value
defaultcyberfoil
chrome / safari / firefoxBrowser preset string
tinfoil(empty)
customhttpUserAgent from config

Tinfoil legacy headers

When legacy auth support is available in the build, Remote requests may also send:

  • Theme: 64 zero digits
  • UID: derived from console CID
  • Version: / Revision: from app version
  • Language: e.g. en, fr
  • HAUTH: HMAC-like token from Remote URL
  • UAUTH: token from URL + credentials

401/403 or HTML login pages are treated as auth failures. Redirect to a URL containing /login fails login.

Save sync (/api/saves/*)

Requires non-legacy Remote mode. Uses the same Remote URL and Basic auth. Compatible with AeroFoil-style servers.

List - GET /api/saves/list

JSON array or { "saves": [ … ] }:

{
  "saves": [
    {
      "title_id": "01007EF00011E000",
      "name": "Example Game",
      "save_id": "abc123",
      "note": "Before final boss",
      "created_at": "2024-01-15T12:00:00Z",
      "created_ts": 1705312800,
      "size": 1048576,
      "download_url": "/api/saves/download/01007EF00011E000/abc123.zip"
    }
  ]
}

Field aliases: titleId, saveId, save_note, downloadUrl, etc.

Upload - POST /api/saves/upload/{TITLEID}

Multipart form:

  • file - zip archive
  • title_id / application_id - 16-char hex
  • note - required from UI for bulk backup

Expect HTTP 2xx on success.

Download / delete

Download via GET on constructed or provided download_url. DELETE endpoints remove by title or by save_id.

Related client settings

KeyDefaultEffect
remoteHideInstalledtrueHide already-installed titles in Remote UI
remoteHideInstalledSectiontrueHide synthetic Installed section
remoteHideIncompatibleCheatsfalseHide cheats that do not match installed builds
remoteAllBaseOnlytrueAll section shows bases only
remoteLegacyModefalseTinfoil compatibility mode
remoteStartGridModefalseOpen Remote in grid view

Icon cache: sdmc:/switch/CyberFoil/remote_icons/ (legacy shop_icons/ is copied on launch).

Minimal compatible server

  1. Listen on HTTP port 8465 (or HTTPS 443).
  2. Implement GET /api/remote/sections returning { "sections": [ … ] }. /api/shop/sections remains accepted.
  3. Serve files at URLs referenced in items; support relative paths.
  4. Optional: GET /api/remote/icon/{TITLEID}, root success MOTD string.
  5. For saves: implement /api/saves/list|upload|download|delete as above.
  6. For cheats: catalog rows plus GET on each cheat URL and optional POST /api/cheats.
  7. For LAN discovery: UDP 8465 replies to OWNFOIL_DISCOVER.
  8. For old Tinfoil remotes: root JSON or TINFOIL binary + legacy headers if encrypted.