Skip to content
This repository has been archived by the owner on Aug 17, 2023. It is now read-only.

How to use the API ?

Skid edited this page May 25, 2019 · 17 revisions

It is really simple.

Your are limited to 1000 requests per minute per ip address, so unless you spam the api you should be fine :)

Every request will return a json output.

If you want C++ for example : https://rcgp.anjara.eu/api/image/cpp

cpp

If json isn't your thing and you want a picture directly, you can use the raw api.

If you want JavaScript for example : https://rcgp.anjara.eu/api/raw/js

Note : You can use this as src for an <img> tag also !

js

Enjoy :D

Issues that we are already aware of.

The "NodeJS is crap" case

In NodeJS, the auto negociation process for ECC curve is crap, so if you try to use the api with NodeJS, generally it will return a magnificent error.

To solve this problem (unless NodeJS developpers fix this stupid issue) you need to specify the curve to use.

Here is an exemple of how to do it.

// I totally disapprove what that thing up says -- leonekmi
const https = require('https');

req = https.request({
	hostname: 'rcgp.anjara.eu',
	port: 443,
	path: '/api/image',
	method: 'GET',
	ecdhCurve: 'X25519' // Or any other curve supported by the webserver.
}, (res) => {
	var data;

	res.on('data', (d) => {
		data = data + d;
	});

	res.on('end', () => {
		var json = JSON.parse(data);
		// do something here
	});
});
req.end();