An (unofficial) API for SafeDonate, with full types support
This API is unofficial, meaning I am not responisble for any damage caused by using this API. This API may be blocked at any time by SafeDonate's team. This API is never stable as SafeDonate can change at any time their website structure that will break this API.
npm install safedonate
# or
yarn add safedonate
import { fetchDonations } from "safedonate";
fetchDonations().then((donations) => {
console.log(donations[0]);
});
//=> JSON object containing donation info
(also compitable with commonjs)
const { fetchDonations } = require("safedonate");
fetchDonations().then((donations) => {
console.log(donations[0]);
});
Will return something like this:
{
"URL (public)": "",
"Title (public)": "",
"Description (public)": "",
"Verification Result (public)": "",
"Original Message (public)": "",
"Is International? (public)": "",
"title_english": "",
"title_spanish": "",
"title_french": "",
"title_german": ""
}
Which can be easily accessed by doing (thanks to the types available in the package):
const { fetchDonations } = require("../build/index");
fetchDonations().then((donations) => {
console.log(donations[0]["URL (public)"]);
});