FreshRSS - Fever API implementation

See the page about our Google Reader compatible API for another possibility and general aspects of API access.

RSS clients

There are many RSS clients existing supporting Fever APIs but they seem to understand the Fever API a bit differently. If your favourite client does not work properly with this API, create an issue and we will have a look. But we can only do that for free clients.

Usage & Authentication

Before you can start to use this API, you have to enable and setup API access, which is documented here, and then re-set the user’s API password.

Then point your mobile application to the URL of fever.php (e.g. https://freshrss.example.net/api/fever.php).

Compatibility

Tested with:

Features

Following features are implemented:

Following features are not supported:

If this API does not work as expected in your RSS reader, you can test it manually with a tool like Postman.

Configure a POST request to the URL https://freshrss.example.net/api/fever.php?api which should give you the result:

{
	"api_version": 3,
	"auth": 0
}

Great, the base setup seems to work!

Now lets try an authenticated call. Fever uses an api_key, which is the MD5 hash of "$username:$apiPassword". Assuming the user is kevin and the password freshrss, here is a command-line example to compute the resulting api_key

api_key=`echo -n "kevin:freshrss" | md5sum | cut -d' ' -f1`

Add a body to your POST request encoded as form-data and one key named api_key with the value your-password-hash:

curl -s -F "api_key=$api_key" 'https://freshrss.example.net/api/fever.php?api'

This shoud give:

{
	"api_version": 3,
	"auth": 1,
	"last_refreshed_on_time": "1520013061"
}

Perfect, you are authenticated and can now start testing the more advanced features. Therefor change the URL and append the possible API actions to your request parameters. Check the original Fever documentation for more infos.

Some basic calls are:

Replace some_id with a real ID from your freshrss_username_entry database.

Debugging

If nothing helps and your clients still misbehaves, add these lines to the start of fever.api:

file_put_contents(__DIR__ . '/fever.log', $_SERVER['HTTP_USER_AGENT'] . ': ' . json_encode($_REQUEST) . PHP_EOL, FILE_APPEND);

Then use your RSS client to query the API and afterwards check the file fever.log.

Credits

This plugin was inspired by the tinytinyrss-fever-plugin.