This lib created for easy access to onlyfans profiles. For analytics only. Dynamic rules fetched from DATAHOARDERS/dynamic-rules on client initialization.
npm i @imperatrona/onlyfans-scraperconst Scrapy = require("@imperatrona/onlyfans-scraper");import Scrapy from "@imperatrona/onlyfans-scraper";
const client = new Scrapy();
try {
const user = await client.getUser("onlyfans");
console.log(user);
} catch (err) {
if (err instanceof Error) {
console.error(err.message);
}
}You can set minimal time to wait between api requests in miliseconds.
client.delay = 5000; // will wait 5s (5000ms) between each api requestsTo reset delay just set delay to 0.
client.delay = 0;You can add proxy agent after initialization.
import Scrapy from "@imperatrona/onlyfans-scraper";
import { HttpsProxyAgent } from "hpagent";
const client = new Scrapy();
const agent = new HttpsProxyAgent({ proxy: "http://0.0.0.0:0000" });
client.setProxy(agent);By default client generate anon credentials, but you can use your personal account.
import Scrapy from "@imperatrona/onlyfans-scraper";
const client = new Scrapy({
userId: "",
userAgent: "",
xBc: "",
cookie: "",
});const client = new Scrapy();
const auth = client.GetSession();