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 Jan 11, 2019 · 17 revisions

It is really simple.

and also, no rate limits but remain cool :)

Every request will return a json output.

If you want C++ for example : https://rcgp.nsa.ovh/api/?language=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.nsa.ovh/raw.php?language=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.nsa.ovh',
	port: 443,
	path: '/api/',
	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();
Clone this wiki locally