This lib created for easy access to onlyfans profiles. For analytics only. Dynamic rules fetched from [DATAHOARDERS/dynamic-rules](https://github.com/DATAHOARDERS/dynamic-rules) on client initialization.
npm install @imperatrona/onlyfans-scraperThis lib created for easy access to onlyfans profiles. For analytics only. Dynamic rules fetched from DATAHOARDERS/dynamic-rules on client initialization.
``shell`
npm i @imperatrona/onlyfans-scraper
`typescript`
const Scrapy = require("@imperatrona/onlyfans-scraper");
`typescript
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.
`typescript`
client.delay = 5000; // will wait 5s (5000ms) between each api requests
To reset delay just set delay to 0.
`typescript`
client.delay = 0;
You can add proxy agent after initialization.
`typescript
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.
`typescript
import Scrapy from "@imperatrona/onlyfans-scraper";
const client = new Scrapy({
userId: "",
userAgent: "",
xBc: "",
cookie: "",
});
`
`typescript``
const client = new Scrapy();
const auth = client.GetSession();