{"size": 692, "ext": "js", "max_stars_repo_path": "example/extract.js", "max_stars_repo_name": "webshotapi/website-screenshot-nodejs", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "example/extract.js", "max_issues_repo_name": "webshotapi/website-screenshot-nodejs", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "example/extract.js", "max_forks_repo_name": "webshotapi/website-screenshot-nodejs", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 21.625, "max_line_length": 68, "alphanum_fraction": 0.5765895954}
const { Client } = require("@webshotapi/client");
const Config = require("./config");

(async () => {
  try {
    const client = new Client(Config.API_KEY);
    const result = await client.extract("https://www.example.com", {
      remove_modals: 1,
      ads: 1,
      width: 1680,
      height: 960,
      extract_selectors: 1,
      extract_words: 1,
      extract_style: 1,
      extract_text: 1,
      extract_html: 1,
    });

    //get json data
    let data = result.json();

    //show result data
    console.log(data);

    //save data to file
    result.save("/tmp/test.json");
  } catch (err) {
    console.log(`Error: ${err.message}`);
    console.log(err?.response);
  }
})();
