|
|
8 часов назад | |
|---|---|---|
| .. | ||
| README.md | 8 часов назад | |
| auth_integration_test.go | 11 часов назад | |
| handler.go | 8 часов назад | |
| integration_client_test.go | 10 часов назад | |
| integration_server_test.go | 11 часов назад | |
| isolation_integration_test.go | 8 часов назад | |
| items_integration_test.go | 8 часов назад | |
| mark_integration_test.go | 8 часов назад | |
| middleware.go | 4 дней назад | |
| middleware_test.go | 11 часов назад | |
| read_integration_test.go | 8 часов назад | |
| response.go | 3 лет назад | |
This document describes the Fever-compatible API implemented by the internal/fever package in this repository.
BASE_URL/fever/GET, write requests should be sent as POST3Fever authentication is enabled per user from the Miniflux integrations page.
Fever Username and Fever Password are configured in Minifluxusername:passwordapi_key parameter, in the query string or the form bodyExample:
api_key = md5("fever_username:fever_password")
Example shell command:
printf '%s' 'fever_username:fever_password' | md5sum
Authentication failure does not return HTTP 401. The middleware returns HTTP 200 with:
{
"api_version": 3,
"auth": 0,
"last_refreshed_on_time": 0
}
On successful authentication, every response includes:
api_version: always 3auth: always 1last_refreshed_on_time: current server Unix timestamp at response timeThe handler selects the first matching operation in this order:
groupsfeedsfaviconsunread_item_idssaved_item_idsitemsmark=itemmark=feedmark=groupIf no selector is provided, the server returns the base authenticated response only.
For read operations, the selector must be present in the query string. For write operations, mark, as, id, and before are read from request form values, so they may come from the query string or a form body.
Lists are always JSON arrays: they are empty, not null, when there is nothing to return.
?groupsReturns:
groups: list of categoriesfeeds_groups: mapping of category IDs to feed IDsResponse shape:
{
"api_version": 3,
"auth": 1,
"last_refreshed_on_time": 1710000000,
"groups": [
{
"id": 1,
"title": "All"
}
],
"feeds_groups": [
{
"group_id": 1,
"feed_ids": "10,11"
}
]
}
Notes:
groups are Miniflux categoriesfeeds_groups.feed_ids is a comma-separated stringgroups but have no feeds_groups entry?feedsReturns:
feeds: list of feedsfeeds_groups: mapping of category IDs to feed IDsFeed fields:
idfavicon_idtitleurlsite_urlis_sparklast_updated_on_timeNotes:
favicon_id is 0 when the feed has no iconis_spark is always 0 in this implementationlast_updated_on_time is the feed check time as a Unix timestamp?faviconsReturns:
favicons: list of favicon objectsFavicon fields:
iddataNotes:
data is a data URL such as image/png;base64,...?unread_item_idsReturns:
unread_item_ids: comma-separated list of unread entry IDsResponse shape:
{
"api_version": 3,
"auth": 1,
"last_refreshed_on_time": 1710000000,
"unread_item_ids": "100,101,102"
}
?saved_item_idsReturns:
saved_item_ids: comma-separated list of starred entry IDs?itemsReturns:
items: list of entriestotal_items: total number of entries of the user, whatever the selectionItem fields:
idfeed_idtitleauthorhtmlurlis_savedis_readcreated_on_timeThe handler applies a fixed limit of 50 items.
Supported parameters:
since_id: returns entries with id > since_id when greater than 0, and the oldest entries otherwise, ordered by id ASCmax_id: returns entries with id < max_id when greater than 0, and the most recent entries otherwise (including 0), ordered by id DESCwith_ids: comma-separated list of entry IDs to fetch, ordered by id ASCSelector precedence inside ?items is:
since_idmax_idwith_idsNotes:
with_ids does not enforce the 50-ID maximum mentioned in older Fever documentation, but the 50-row limit still applies: a longer list returns its 50 lowest IDswith_ids members are ignored, and a list without valid IDs returns no itemsitems is requested without since_id, max_id, or with_ids, the 50 oldest entries are returned, ordered by id ASChtml is returned after Miniflux content rewriting and may include media-proxy-rewritten URLsExample:
{
"api_version": 3,
"auth": 1,
"last_refreshed_on_time": 1710000000,
"total_items": 245,
"items": [
{
"id": 100,
"feed_id": 10,
"title": "Example entry",
"author": "Author",
"html": "<p>Content</p>",
"url": "https://example.org/post",
"is_saved": 0,
"is_read": 1,
"created_on_time": 1709990000
}
]
}
Normal successful write operations return the base authenticated response:
{
"api_version": 3,
"auth": 1,
"last_refreshed_on_time": 1710000000
}
mark=itemParameters:
mark=itemid=<entry_id>as=read|unread|saved|unsavedBehavior:
as=read: marks the entry as readas=unread: marks the entry as unreadas=saved: stars the entry, and sends it to the enabled integrations when it was not starred yetas=unsaved: unstars the entryNotes:
saved and unsaved set the starred state: sending them twice has the same effect as sending them onceas value changes nothingid is missing, invalid or not positive, the server returns the base response without changesmark=feedParameters:
mark=feedas=readid=<feed_id>before=<unix_timestamp>Behavior:
published_at < before, before sending the responseNotes:
id is missing, invalid or not positive, the server returns the base response without changesbefore is missing or invalid, it is treated as Unix time 0, which usually means nothing is marked as readmark=groupParameters:
mark=groupas=readid=<group_id>before=<unix_timestamp>Behavior:
id=0: marks all unread entries as read, or only those with published_at < before when before is a positive timestampid>0: marks unread entries in the matching category as read when published_at < beforeNotes:
id=0 must be sent explicitly: if id is missing, invalid or negative, the server returns the base response without changesbefore is missing or invalid for id>0, it is treated as Unix time 0, which usually means nothing is marked as readAuthentication failures:
200{"api_version":3,"auth":0,"last_refreshed_on_time":0}Invalid write requests, such as a missing or invalid id, are not errors: they return the base authenticated response and change nothing.
Internal errors:
500body:
{
"error_message": "..."
}
This implementation is Fever-compatible, but it does not match every detail of historical Fever API docs.
api=xml is mentioned in code comments but is not implementedapi_version is 3last_refreshed_on_time is set to the current response time, not the timestamp of the most recently refreshed feedKindling and Sparks super groups are not returnedfeeds[].is_spark is always 0mark=item also accepts as=unreadmark=feed and mark=group ignore the as parameter: they always mark entries as readFetch groups:
curl -s 'https://miniflux.example.com/fever/?api_key=TOKEN&groups'
Fetch most recent items:
curl -s 'https://miniflux.example.com/fever/?api_key=TOKEN&items&max_id=0'
Fetch items after a known ID:
curl -s 'https://miniflux.example.com/fever/?api_key=TOKEN&items&since_id=123'
Mark an item as read:
curl -s -X POST 'https://miniflux.example.com/fever/' \
-d 'api_key=TOKEN' \
-d 'mark=item' \
-d 'as=read' \
-d 'id=123'
Mark a feed as read before a timestamp:
curl -s -X POST 'https://miniflux.example.com/fever/' \
-d 'api_key=TOKEN' \
-d 'mark=feed' \
-d 'as=read' \
-d 'id=10' \
-d 'before=1710000000'
Mark all items as read through the group endpoint:
curl -s -X POST 'https://miniflux.example.com/fever/' \
-d 'api_key=TOKEN' \
-d 'mark=group' \
-d 'as=read' \
-d 'id=0'