
Website Contacts Extractor
Website Contacts Extractor
The Website Contacts Extractor API allows you to easily extract contact information (emails and social media links) from any website. It gets these details from the "Contact Us" pages of websites.
Installation
Install the package using npm:
npm install website-contacts-extractor
Usage
To use the library, you need to import the Api
class, create an instance with your API key, and then call the getContacts
method.
To get your API key, please create an account at omkar.cloud.
import Api from 'website-contacts-extractor';
async function main() {
// Create an instance of the API with your API key
const api = new Api({
apiKey: 'YOUR_API_KEY',
createResponseFiles: true, // Optional: saves responses to files for debugging, remove this in production.
});
const contacts = await api.getContacts('https://www.apple.com/');
}
main();
Parameters
The Api
constructor accepts the following parameters:
apiKey
(string, required): Your API key for the service.createResponseFiles
(boolean, optional, default:false
): If set totrue
, the library will save the JSON response from the API to a file in theoutput/responses
directory. Useful for debugging. Remove this parameter in production.