website-contacts-extractor
v1.1.5
Published
Website Contacts Extractor allows you to easily extract contact information (emails and social media links) from any website.
Maintainers
Keywords
Readme
Website Contacts Extractor
The Website Contacts Extractor is an API client for the Website Contacts Extractor that 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-extractorUsage
To use the library, you need to import the Api class, create an instance with your API key, and then call the getContacts method.
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/responsesdirectory. Useful for debugging. Remove this parameter in production.
License
This project is licensed under the Apache-2.0 License. See the LICENSE file for details.
