~0wx.eu~ :: Datei-Hosting und andere nützliche Tools


Hochladen Kurze URL Riesige URL Pastebin Informationen Melden Login
Deutsch
English English Español Español Català Català Galego Galego Português Português Français Français Italiano Italiano Română Română Nederlands Nederlands Dansk Dansk Svenska Svenska Bokmål Bokmål Íslenska Íslenska 日本語 日本語 简体中文 简体中文 繁體中文 繁體中文 한국어 한국어 Euskara Euskara Esperanto Esperanto Polski Polski Čeština Čeština Українська Українська Русский Русский Türkçe Türkçe Bahasa Indonesia Bahasa Indonesia Bahasa Melayu Bahasa Melayu

Es gibt eine API für alle Funktionen auf 0wx.eu. Du kannst sie für Skripte oder Konsolen-Befehle verwenden.

Alles, was die Formulare dieser Seite tun, für Skripte. Jede Antwort ist JSON, auch Fehler, damit du nie raten musst, ob ein Rumpf ein Ergebnis oder eine Erklärung ist.

Eine Anfrage stellen

Sende POST an den Endpunkt, entweder mit Formularparametern oder mit einem JSON-Rumpf. Beides ist gleichwertig; nimm, was dein Werkzeug leichter macht. Der Parameter action wählt die Aktion. Nutze --data-urlencode für alles, was jemand eingetippt hat — Paste-Text, eine URL, eine Übersetzung — denn -d sendet den Wert roh und er wird beim ersten & abgeschnitten. Einfaches -d genügt für feste Werte wie action selbst.

curl -X POST https://0wx.eu/api.cgi \
     -d action=paste --data-urlencode 'content=hello & world'

curl -X POST https://0wx.eu/api.cgi \
     -H 'Content-Type: application/json' \
     -d '{"action":"paste","content":"hello & world"}'

wget -qO- --header='Content-Type: application/json' \
     --post-data '{"action":"paste","content":"hello & world"}' https://0wx.eu/api.cgi
Werte mit &

In einem Formularrumpf trennt & Parameter, und curl -d kodiert nicht, was du übergibst. Eine URL mit Query-String wird deshalb beim ersten & abgeschnitten, der Rest kommt als eigene Parameter an. Nimm --data-urlencode oder sende JSON. Überzählige Parameter werden abgelehnt statt ignoriert, das schlägt also laut fehl, statt einen halben Link zu speichern.

# wrong -- the value is cut at the &
curl -X POST https://0wx.eu/api.cgi \
     -d action=tinyurl -d 'url=https://example.com/?a=1&b=2'

# right
curl -X POST https://0wx.eu/api.cgi \
     -d action=tinyurl --data-urlencode 'url=https://example.com/?a=1&b=2'

# also right -- JSON needs no escaping
curl -X POST https://0wx.eu/api.cgi -H 'Content-Type: application/json' \
     -d '{"action":"tinyurl","url":"https://example.com/?a=1&b=2"}'

# wget has no --data-urlencode, so percent-encode it yourself...
wget -qO- --post-data 'action=tinyurl&url=https%3A%2F%2Fexample.com%2F%3Fa%3D1%26b%3D2' https://0wx.eu/api.cgi

# ...or send JSON, which needs no encoding at all
wget -qO- --header='Content-Type: application/json' \
     --post-data '{"action":"tinyurl","url":"https://example.com/?a=1&b=2"}' https://0wx.eu/api.cgi
Authentifizierung

Optional. Ohne Schlüssel ist eine Anfrage anonym und verhält sich genau wie ein anonymer Besuch — das Ergebnis ist so oder so öffentlich, der Unterschied ist nur, ob es in deiner Dateiliste landet. Erzeuge einen Schlüssel auf deiner Kontoseite und sende ihn als Bearer-Token; als Parameter apikey geht auch, aber ein Schlüssel in der Adresse landet in Serverprotokollen und im Browserverlauf.

curl -X POST https://0wx.eu/api.cgi \
     -H 'Authorization: Bearer YOUR_KEY' \
     -d action=whoami

wget -qO- --header='Authorization: Bearer YOUR_KEY' \
     --post-data 'action=whoami' https://0wx.eu/api.cgi
Aktionen
actionParameterBeschreibung
whoamiPrüft, ob ein Schlüssel funktioniert, und nennt die aktuellen Grenzen. Kostet nichts; ruf das zuerst auf.
ipReports your address, its PTR, the country, state and city it geolocates to, the coordinates, and the user agent you sent. Needs no key and answers the same with or without one. Deliberately narrower than the web page: no WHOIS, no DNS zone and no blocklist lookups, so calling it costs the server nothing but a local database read.
uploadfile (wiederholbar), resize, lifetime, gallery or gLädt eine oder mehrere Dateien hoch. Muss multipart/form-data sein.
tinyurlurl, lifetimeKürzt eine URL.
hugeurlurl, lifetimeVerlängert eine URL, absurd, mit Absicht.
pastecontent, lifetimeSpeichert einen Textblock und gibt einen Link darauf zurück.
translatecontent, toÜbersetzt Text. to ist ein ISO-639-Code — das sind nicht immer Ländercodes: Dänisch ist da, nicht dk.
listfilespage, gLists your files with everything the Info panel shows, plus the thumbnail and direct link. g limits it to one gallery, or none for files in no gallery.
listpastespageLists your pastes, with a 200-character preview of each rather than the whole body.
listurlspageLists your short and huge URLs, with the address each one points at.
otlshareCreates a one-time link to one of your files. Each call mints a new one, so handing the same file to two people gives two links.
listotlpageLists your active one-time links, the file each points at, and whether that file has since expired.
listgalleriesLists your galleries with their ids, names, file counts and publishing state.
galleryg, publishReports a gallery's publishing state, and changes it when publish is given.
moveshare (wiederholbar), gallery or gMoves files into a gallery, by name (created if new) or by id. Both omitted moves them back to the main listing.
deleteshare (wiederholbar), g, otl, withfilesDeletes files, pastes, short URLs, galleries, one-time links, or any mix. A share is matched against your files first and then against your pastes and links, so the caller does not have to sort them by type. One-time links go in otl, separately: removing a link must not be confusable with deleting the file it points at.

☉ These actions need an API key. They read or change one account's own data, so there is no anonymous form of them.

Several at once

share and g accept a repeated field, a JSON array, or a comma-separated list — whichever your tooling makes easiest. Duplicates are ignored.

curl -X POST https://0wx.eu/api.cgi -H 'Authorization: Bearer YOUR_KEY' \
     -d action=move -d share=Ab3xK9pQ -d share=Zz7yT2mN --data-urlencode 'gallery=Holiday 2026'

curl -X POST https://0wx.eu/api.cgi -H 'Authorization: Bearer YOUR_KEY' \
     -d action=delete -d 'share=Ab3xK9pQ,Zz7yT2mN'

curl -X POST https://0wx.eu/api.cgi -H 'Content-Type: application/json' \
     -H 'Authorization: Bearer YOUR_KEY' \
     -d '{"action":"move","share":["Ab3xK9pQ","Zz7yT2mN"],"g":7}'

wget -qO- --header='Authorization: Bearer YOUR_KEY' \
     --post-data 'action=delete&share=Ab3xK9pQ,Zz7yT2mN' https://0wx.eu/api.cgi
Galleries

Wherever a gallery is named — on upload or on move — it is given the same two ways: g for an existing id, or gallery for a name, which is created if it is new. If both are sent, g wins. The reply carries the gallery id. Note that deleting a gallery removes only the gallery, leaving its files in the main listing — unlike the web form, which deletes them after asking. Pass withfiles=true to delete them as well: a script tidying up its groupings should not lose the uploads by accident.

curl -X POST https://0wx.eu/api.cgi -H 'Authorization: Bearer YOUR_KEY' \
     -F action=upload -F file=@photo.jpg --form-string 'gallery=Holiday 2026'

curl -X POST https://0wx.eu/api.cgi -H 'Authorization: Bearer YOUR_KEY' \
     -d action=gallery -d g=7 -d publish=true

wget -qO- --header='Authorization: Bearer YOUR_KEY' \
     --post-data 'action=gallery&g=7&publish=true' https://0wx.eu/api.cgi
Dateien hochladen

Uploads können den JSON-Rumpf nicht nutzen, weil eine Datei als multipart gesendet werden muss. Wiederhole den Teil file, um mehrere auf einmal zu senden. Jede Datei wird einzeln gemeldet: die Antwort enthält eine Liste files mit den angenommenen und eine Liste rejected mit den abgelehnten, ein Teilerfolg bleibt also ein Erfolg.

curl -X POST https://0wx.eu/api.cgi \
     -H 'Authorization: Bearer YOUR_KEY' \
     -F action=upload \
     -F file=@photo.jpg \
     -F file=@notes.txt \
     -F lifetime=7d

There is no wget form of this one. wget cannot build a multipart/form-data body — it has no equivalent of curl's -F — and uploads must be multipart. Use curl, or assemble the body and boundary yourself and send it with --post-file.

Speicherdauer

Optional bei jeder Aktion, die etwas speichert. Akzeptiert reine Sekunden oder eine Zahl gefolgt von m, h oder d — dieselben Formen wie die Webformulare. Lass es weg oder gib 0 an, um den Eintrag unbegrenzt zu behalten.

Antworten

Jede Antwort ist ein JSON-Objekt mit einem Feld ok. Bei Erfolg trägt es das Ergebnis, bei Fehlschlag einen festen Code error und eine lesbare message. Verzweige über den Code, protokolliere die Meldung.

{"ok":true,"type":"paste","share":"Ab3xK9pQ",
 "url":"https://0wx.eu/p/Ab3xK9pQ","bytes":11}

{"ok":false,"error":"url_too_long",
 "message":"URL exceeds the maximum length."}
Fehlercodes
errorHTTPBeschreibung
unknown_action400Diese Aktion gibt es nicht.
bad_json400Der Rumpf war kein gültiges JSON, oder ein Feld enthielt eine verschachtelte Struktur.
unexpected_parameter400Es kam ein Parameter an, den diese Aktion nicht kennt — meist ein unkodiertes & in einem Wert. Die Meldung nennt die Parameter.
bad_key401Der Schlüssel wurde nicht erkannt. Ein falscher Schlüssel wird abgelehnt und nicht stillschweigend als anonym behandelt.
bad_url400Die URL ist fehlerhaft oder nutzt ein anderes Schema als http(s), ftp oder gopher.
bad_lifetime400Die Speicherdauer war keine Zahl und keine Zahl gefolgt von m, h oder d.
no_content400Es wurde nichts zum Speichern gesendet.
url_too_long413Die URL ist länger als erlaubt.
paste_too_long413Der Text ist größer als das Paste-Limit. Grenzen zählen Bytes in UTF-8, nicht-lateinischer Text zählt also mehr, als die Zeichenzahl vermuten lässt.
too_many_files413Mehr Dateien, als ein Aufruf annimmt.
no_usable_files415Alle Dateien wurden abgelehnt. Der Grund steht in der Liste rejected.
backend_unavailable502Der Übersetzungsdienst hat nicht geantwortet.
internal500Etwas ist unerwartet fehlgeschlagen. Es wurde protokolliert.
Grenzen

Ruf whoami auf, statt die Werte fest einzubauen — sie werden vom Betreiber gesetzt und können sich ändern. Größen sind Bytes in UTF-8.

A shell client

0wx.sh wraps all of the above. It is plain POSIX shell and needs nothing but curl, and it is short enough to read before you run it — which is the right thing to do with a script that will hold your API key. Put the key in OWX_KEY rather than passing --key, and it stays out of your shell history.

wget https://0wx.eu/clients/0wx.sh
chmod +x 0wx.sh
export OWX_KEY=YOUR_KEY
./0wx.sh help
./0wx.sh paste --content 'hello & world'
A Python client

0wx.py does the same as the shell client, but parses the reply and prints what the fields mean rather than handing you raw JSON — add --json when you want the raw form back. Standard library only: no requests, nothing to install. If you are writing your own client, its send() and report() functions are the parts worth reading: between them they show how to build the request, how to get the message out of a failed one, and what the replies contain.

wget https://0wx.eu/clients/0wx.py
chmod +x 0wx.py
export OWX_KEY=YOUR_KEY
./0wx.py listfiles
./0wx.py listfiles --json | jq '.files[].url'
A Perl client

0wx.pl does the same as the Python one and prints the same output. Core modules only — HTTP::Tiny and JSON::PP have shipped with Perl since 5.14, so there is nothing to install. Worth reading next to the Python client if you are writing your own: the two languages fail differently on a broken request, and both scripts say where.

wget https://0wx.eu/clients/0wx.pl
chmod +x 0wx.pl
export OWX_KEY=YOUR_KEY
./0wx.pl listfiles
A window, if you prefer one

0wx-gtk.pl is a small GTK window with tabs for uploading, pasting, shortening, and browsing your files — as a list or as a gallery of thumbnails, filtered by gallery. It is the one client here with a dependency: the Perl GTK3 bindings, which a graphical program cannot avoid. Everything else it uses ships with Perl. The key is held in memory only: closing the window forgets it, and setting OWX_KEY fills it in at startup. Whatever it shows you, the server's raw reply is one click away under “Server reply”.

apt install libgtk3-perl        # or: dnf install perl-Gtk3
wget https://0wx.eu/clients/0wx-gtk.pl
chmod +x 0wx-gtk.pl
OWX_KEY=YOUR_KEY ./0wx-gtk.pl
An Android app

0wx-android.apk does what the other clients do, from a phone: uploading, pasting, shortening, translating, and browsing your files as a list or a gallery. Sharing a file to it from any other app uploads it, and sharing text stores it as a paste. It is not on any app store, so your device will ask you to allow installing it — which is a question worth taking seriously in general, and the reason the whole source is also here: open it in Android Studio and build it yourself rather than trusting the file. Building needs JDK 21; BUILDING.md inside says why.

https://0wx.eu/clients/0wx-android.apk        # install it
https://0wx.eu/clients/0wx-android.zip        # build it yourself
Hinweise

Es gibt bewusst keine Aktion zum Abholen entfernter Dateien. Sie würde den Server eine URL nach Wahl des Aufrufers holen lassen, was eine Angriffsfläche für Request Forgery ist, und ein Skript kann das weit härter treiben als ein Formular. Lade die Datei stattdessen selbst hoch.


(p) 2018 0wx.eu -/- Unterstützt durch Linux und GNU. Lebe frei oder stirb! (root@0wx.eu)