Unstable API

Source code related to this project is available. Currently the primary location is several github organizations:

API Terms of Use

Our public API is provided free of charge for personal tools, reader integrations, and non-commercial projects. By sending requests to our API, you agree to the following rules

  1. Identify Your Client: You must include a clear, accurate User-Agent header identifying your application or script (for example, MyReaderApp/1.0 (+https://example.com)). Do not spoof browser User-Agents.
  2. Respect Rate Limits: You must honor all rate limits, HTTP 429 Too Many Requests responses, and Retry-After headers. Attempting to bypass rate limits by rotating IP addresses or splitting requests across multiple origins is prohibited.
  3. No Bulk Archiving or Commercial Redistribution: You may not use the API to bulk-scrape entire archives, build a public download mirror/library, or sell converted files. All API usage remains subject to our Terms of Service and Copyright / Author Opt-Out Policy.
  4. Availability & Enforcement: This API is provided "as is" without uptime guarantees or warranties, and endpoints may change or be discontinued at any time. We reserve the right to throttle or permanently block any IP address or User-Agent that violates these terms or places excessive load on our infrastructure.

You may make requests directly to FicHub's internal API, though no stability guarantee is made at this time.

Requesting exports

The main v0 endpoint is /api/v0/epub which takes a q parameter for the fic to export. That is, make a GET request to https://fichub.net/api/v0/epub?q={fic}. Ex (please set a custom user-agent -- ie use some identifier for your project and include contact info after the +, and make requests in serial):

> curl -s -A "fichub-client/0.0.1 +@iris on discord" https://fichub.net/api/v0/epub?q=https://forums.spacebattles.com/threads/nemesis-worm-au.747148 | jq '.'

		
{
  "epub_url": "/cache/epub/NtePoQrV/Nemesis_by_BeaconHill-NtePoQrV.epub?h=47bd33893936ece7315060d0b09fe7c9",
  "err": 0,
  "fixits": [],
  "hashes": {
    "epub": "47bd33893936ece7315060d0b09fe7c9"
  },
  "html_url": "/cache/html/NtePoQrV?cv=26&eh=47bd33893936ece7315060d0b09fe7c9",
  "info": "Nemesis by BeaconHill\n65754 words in 14 chapters\nStatus: ongoing\nUpdated: 2023-01-28 - 2 months 7 days  ago\n",
  "meta": {
    "author": "BeaconHill",
    "authorId": 2446,
    "authorLocalId": "beaconhill.295356",
    "authorUrl": "https://forums.spacebattles.com/members/beaconhill.295356/",
    "chapters": 14,
    "created": "2022-03-05T19:43:19",
    "description": "<lt;p>Nemesis<lt;/p><lt;p>Worm AU<lt;/p><lt;p>It was June 2011, and Emma Barnes was the queen bee of her high school…<lt;/p>",
    "extraMeta": null,
    "id": "NtePoQrV",
    "rawExtendedMeta": null,
    "source": "https://forums.spacebattles.com/threads/nemesis-worm-au.747148/",
    "sourceId": 12,
    "status": "ongoing",
    "title": "Nemesis",
    "updated": "2023-01-28T23:13:19",
    "words": 65754
  },
  "mobi_url": "/cache/mobi/NtePoQrV?cv=26&eh=47bd33893936ece7315060d0b09fe7c9",
  "notes": [],
  "pdf_url": "/cache/pdf/NtePoQrV?cv=26&eh=47bd33893936ece7315060d0b09fe7c9",
  "q": "https://forums.spacebattles.com/threads/nemesis-worm-au.747148",
  "slug": "Nemesis_by_BeaconHill-NtePoQrV",
  "urlId": "NtePoQrV",
  "urls": {
    "epub": "/cache/epub/NtePoQrV/Nemesis_by_BeaconHill-NtePoQrV.epub?h=47bd33893936ece7315060d0b09fe7c9",
    "html": "/cache/html/NtePoQrV?cv=26&eh=47bd33893936ece7315060d0b09fe7c9",
    "mobi": "/cache/mobi/NtePoQrV?cv=26&eh=47bd33893936ece7315060d0b09fe7c9",
    "pdf": "/cache/pdf/NtePoQrV?cv=26&eh=47bd33893936ece7315060d0b09fe7c9"
  }
}
		
		

The response will have "err":0 if the fic was successfully exported. You can then GET one of the urls fields to (generate and) download the fic in a particular format:

curl -s -o "ex.epub" "https://fichub.net/cache/epub/NtePoQrV/Nemesis_by_BeaconHill-NtePoQrV.epub?h=47bd33893936ece7315060d0b09fe7c9" ; echo "status: $?"

status: 0

du -h ex.epub ; md5sum ex.epub

129K ex.epub 47bd33893936ece7315060d0b09fe7c9 ex.epub

Requesting metadata

An alternate endpoint is provided if you're simply trying to get pre-parsed metadata. Call the /api/v0/meta endpoint, passing a q parameter with the fic in question. Ex:

> curl -s -A "fichub-client/0.0.1 +@iris" https://fichub.net/api/v0/meta?q=https://forums.spacebattles.com/threads/nemesis-worm-au.747148 | jq '.'

		
{
  "author": "BeaconHill",
  "authorId": 2446,
  "authorLocalId": "beaconhill.295356",
  "authorUrl": "https://forums.spacebattles.com/members/beaconhill.295356/",
  "chapters": 14,
  "created": "2022-03-05T19:43:19",
  "description": "<p>Nemesis</p><p>Worm AU</p><p>It was June 2011, and Emma Barnes was the queen bee of her high school…</p>",
  "extraMeta": null,
  "id": "NtePoQrV",
  "rawExtendedMeta": null,
  "source": "https://forums.spacebattles.com/threads/nemesis-worm-au.747148/",
  "sourceId": 12,
  "status": "ongoing",
  "title": "Nemesis",
  "updated": "2023-01-28T23:13:19",
  "words": 65754
}
		
		

Contact

Need to report an issue, request support for a site, offer a suggestion, want to contribute, or just say 'hi'? Feel free to join the discord, ##fichub on Libera.Chat, send us fan (or not so fan) mail at verdant at fichub dot net, via u/iridescent_beacon on reddit, or open an issue on the repository at github.com/FicHub/fichub.net.