### Installation and Initialization Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Enrichments.md Instructions on how to install the Outscraper Node.js package and initialize the client with your API key. ```APIDOC ## Installation Install the package with: ```bash npm install outscraper --save # Or yarn add outscraper ``` ## Initialization ```js const Outscraper = require('outscraper'); // Or using ES modules: import Outscraper from 'outscraper'; let client = new Outscraper('SECRET_API_KEY'); ``` ``` -------------------------------- ### Install Outscraper Node.js Package Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Google Directions.md Install the Outscraper Node.js package using npm or yarn. This is the first step before initializing the client. ```bash npm install outscraper --save ``` ```bash yarn add outscraper ``` -------------------------------- ### Install Outscraper SDK Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Company Insights.md Use npm or yarn to add the package to your project dependencies. ```bash npm install outscraper --save # Or yarn add outscraper ``` -------------------------------- ### Perform API Operations Source: https://github.com/outscraper/outscraper-node/blob/main/README.md Examples for searching Google Maps, retrieving place reviews, and scraping website contacts. ```javascript // Search for businesses in specific locations: client.googleMapsSearch(['restaurants brooklyn usa'], limit=20, language='en', region='us').then(response => { console.log(response); }); // Or using ES modules and async/await: (async () => { const response = await client.googleMapsSearch(['restaurants brooklyn usa'], limit=20, language='en', region='us'); console.log(response); })(); // Get data of the specific place by id client.googleMapsSearch(['rChIJrc9T9fpYwokRdvjYRHT8nI4'], language='en').then(response => { console.log(response); }); // Get reviews of the specific place by id client.googleMapsReviews(['rChIJrc9T9fpYwokRdvjYRHT8nI4'], reviewsLimit=20, language='en').then(response => { console.log(response); }); // Get reviews of the specific place by id using async mode client.googleMapsReviews( ['rChIJrc9T9fpYwokRdvjYRHT8nI4'], reviewsLimit=20, limit=1, sort='most_relevant', skip=0, start=null, cutoff=null, cutoffRating=null, ignoreEmpty=false, language='en', region=null, reviewsQuery=null, lastPaginationId=null, asyncRequest=true // Enable async mode ).then(response => { console.log('Request ID:', response.requestId); // You can use the requestId to check the status of the request later client.getRequestArchive(response.requestId).then(status => { console.log('Request Status:', status); }); }); // Search contacts from website client.emailsAndContacts(['outscraper.com']).then(response => { console.log(response); }); ``` -------------------------------- ### Get SimilarWeb Website Data Source: https://context7.com/outscraper/outscraper-node/llms.txt Retrieve website traffic and analytics data from SimilarWeb. Provide a list of website domains to query. ```javascript client.similarweb(['outscraper.com', 'google.com']).then(response => { console.log(response); }); ``` -------------------------------- ### Get Business Details by ID Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Businesses.md This snippet demonstrates how to retrieve detailed information about a specific business using its unique ID. You can specify which fields you want to retrieve and whether to include reviews. ```APIDOC ## GET /businesses/{business_id} ### Description Retrieves detailed information for a specific business by its ID. ### Method GET ### Endpoint `/businesses/{business_id}` ### Parameters #### Path Parameters - **business_id** (string) - Required - The unique identifier of the business. #### Query Parameters - **fields** (array of strings) - Optional - A list of fields to retrieve (e.g., 'name', 'phone', 'website', 'address', 'rating', 'reviews'). - **reviews_only** (boolean) - Optional - If true, only reviews will be returned. Defaults to false. ### Request Example ```javascript client.businessesGet( 'YOUR_BUSINESS_ID', ['name', 'phone', 'website', 'address', 'rating', 'reviews'], false ).then(response => { console.log(response); }); ``` ### Response #### Success Response (200) - **business_details** (object) - An object containing the requested business details. #### Response Example ```json { "name": "Example Business", "phone": "+1234567890", "website": "https://www.example.com", "address": "123 Example St, City, Country", "rating": 4.5, "reviews": [ { "user": "John Doe", "rating": 5, "text": "Great service!" } ] } ``` ``` -------------------------------- ### Get Google Maps Directions Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Google Directions.md Use the googleMapsDirections method to retrieve directions between multiple sets of origin-destination points. Requires an initialized Outscraper client. ```javascript client.googleMapsDirections([ ['29.696596, 76.994928', '30.715966244353, 76.8053887016268'], ['29.696596, 76.994928', '30.723065, 76.770169'] ]).then(response => { console.log(response); });; ``` -------------------------------- ### Google Maps Directions Source: https://context7.com/outscraper/outscraper-node/llms.txt Get travel information and directions between locations. ```APIDOC ## GET /googleMapsDirections ### Description Get directions and travel information between locations using Google Maps. ### Parameters #### Request Body - **locations** (array) - Required - Origin-destination pairs - **departureTime** (string) - Optional - Departure time - **finishTime** (string) - Optional - Finish time - **interval** (string) - Optional - Time interval - **travelMode** (string) - Optional - Travel mode (default: 'best') - **language** (string) - Optional - Language (default: 'en') - **region** (string) - Optional - Region (default: 'us') ``` -------------------------------- ### Get Specific Place Data by ID Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Google Maps.md Retrieve detailed information for a specific place using its Google Maps place ID. Specify the language for the results. ```javascript client.googleMapsSearch(['ChIJrc9T9fpYwokRdvjYRHT8nI4'], language='en').then(response => { console.log(response); }); ``` -------------------------------- ### Google Maps Search with Email & Contact Enrichment Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Enrichments.md Example of enriching Google Maps search results with emails and contacts, and validating emails using Outscraper's services. ```APIDOC ## Usage ```js # Enriching data from Google Maps with Emails & Contacts Scraper and validating emails: client.googleMapsSearch( ["bars ny usa"], limit=10, // limit of palces per each query language='en', region='US', skip=0, dropDuplicates=false, enrichment=['domains_service', 'emails_validator_service'] ).then(response => { response.forEach(queryPlaces => { queryPlaces.forEach(place => { console.log('name: ', place); }); }); }); ``` ``` -------------------------------- ### Enrich Phone Number Information Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Phones Validator.md Use the phonesEnricher method to get information about a phone number. Pass an array of phone numbers to the method. ```javascript // Get information about the phone number: client.phonesEnricher(['12812368208']).then(response => { console.log(response); });; ``` -------------------------------- ### Use Async Request Mode for Large Scrapes Source: https://context7.com/outscraper/outscraper-node/llms.txt Enable async mode for large requests that may take time to process. The API returns a request ID to check status and retrieve results later. Includes examples for checking request status and history. ```javascript // Make async request for reviews async function getReviewsAsync() { const response = await client.googleMapsReviews( ['ChIJrc9T9fpYwokRdvjYRHT8nI4'], reviewsLimit=20, reviewsQuery=null, limit=1, sort='most_relevant', lastPaginationId=null, start=null, cutoff=null, cutoffRating=null, ignoreEmpty=false, language='en', region=null, reviewsQuery=null, lastPaginationId=null, asyncRequest=true // Enable async mode ); console.log('Request ID:', response.id); // Check request status later const status = await client.getRequestArchive(response.id); console.log('Request Status:', status.status); if (status.status === 'Completed') { console.log('Data:', status.data); } return response; } // Get running and completed requests history const runningRequests = await client.getRequestsHistory('running'); const completedRequests = await client.getRequestsHistory('finished'); ``` -------------------------------- ### Fetch SimilarWeb Data Source: https://github.com/outscraper/outscraper-node/blob/main/examples/SimilarWeb Scraper.md Use the initialized client to fetch SimilarWeb analytics data for a given domain. The response is logged to the console. ```javascript client.similarweb(['apple.com']).then(response => { console.log(response); });; ``` -------------------------------- ### Perform Async Google Maps Reviews Request Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Async Google Maps Reviews.md Demonstrates initiating an asynchronous request using both async/await and Promise syntax, including retrieving the request ID and checking status. ```javascript const Outscraper = require('outscraper'); const client = new Outscraper('YOUR_API_KEY'); // Example 1: Get reviews of a specific place by ID using async mode async function getReviewsAsync() { try { // Make the request with asyncRequest=true const response = await client.googleMapsReviews( ['rChIJrc9T9fpYwokRdvjYRHT8nI4'], // Place ID 20, // reviewsLimit 1, // limit 'most_relevant', // sort 0, // skip null, // start null, // cutoff null, // cutoffRating false, // ignoreEmpty 'en', // language null, // region null, // reviewsQuery null, // lastPaginationId true // asyncRequest - set to true to enable async mode ); // When asyncRequest=true, the response will contain a requestId console.log('Request ID:', response.requestId); // You can use the requestId to check the status of the request later const requestStatus = await client.getRequestArchive(response.requestId); console.log('Request Status:', requestStatus); return response; } catch (error) { console.error('Error:', error); } } // Example 2: Using Promise syntax client.googleMapsReviews( ['rChIJrc9T9fpYwokRdvjYRHT8nI4'], 20, // reviewsLimit 1, // limit 'most_relevant', // sort 0, // skip null, // start null, // cutoff null, // cutoffRating false, // ignoreEmpty 'en', // language null, // region null, // reviewsQuery null, // lastPaginationId true // asyncRequest - set to true ).then(response => { console.log('Request ID:', response.requestId); return client.getRequestArchive(response.requestId); }).then(status => { console.log('Request Status:', status); }).catch(error => { console.error('Error:', error); }); ``` -------------------------------- ### Initialize Outscraper Client Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Company Insights.md Configure the client using your API key. Supports both CommonJS and ES module imports. ```javascript const Outscraper = require('outscraper'); // Or using ES modules: import Outscraper from 'outscraper'; let client = new Outscraper('SECRET_API_KEY'); ``` -------------------------------- ### Retrieve Trustpilot Reviews Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Trustpilot Reviews Scraper.md Fetch reviews for a specific Trustpilot business URL using the client instance. ```javascript // Get information about the reviews from Trustpilot: client.trustpilotReviews(['https://www.trustpilot.com/review/outscraper.com']).then(response => { console.log(response); });; ``` -------------------------------- ### Initialize Outscraper Client Source: https://context7.com/outscraper/outscraper-node/llms.txt Initialize the Outscraper client with your API key. Supports both CommonJS and ES module syntax. ```javascript const Outscraper = require('outscraper'); ``` ```javascript // Or using ES modules: import Outscraper from 'outscraper'; ``` ```javascript const client = new Outscraper('YOUR_API_KEY'); ``` -------------------------------- ### Initialize Outscraper Client Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Google Directions.md Initialize the Outscraper client with your secret API key. Supports both CommonJS and ES module imports. ```javascript const Outscraper = require('outscraper'); ``` ```javascript import Outscraper from 'outscraper'; ``` ```javascript let client = new Outscraper('SECRET_API_KEY'); ``` -------------------------------- ### Perform Trustpilot Search Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Trustpilot Search Scraper.md Execute a search query on Trustpilot and handle the returned response. ```javascript // Get information about the search results from Trustpilot: client.trustpilotSearch(['real estate']).then(response => { console.log(response); });; ``` -------------------------------- ### Search Trustpilot Businesses and Reviews Source: https://context7.com/outscraper/outscraper-node/llms.txt Search for businesses on Trustpilot and scrape their reviews. Use search terms and pagination for business searches, and review URLs for direct review scraping. Enrichment options are also available. ```javascript // Search Trustpilot businesses client.trustpilotSearch(['software company'], limit=100, skip=0).then(response => { console.log(response); }); // Get Trustpilot reviews client.trustpilotReviews(['https://www.trustpilot.com/review/outscraper.com'], limit=100).then(response => { console.log(response); }); // Get Trustpilot business data with enrichment client.trustpilot(['outscraper.com'], enrichment=['reviews'], fields='').then(response => { console.log(response); }); ``` -------------------------------- ### Perform Google Search Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Google SERP.md Use the client to perform a Google search for specified queries, language, and region. The results are returned as a promise. ```javascript client.googleSearch(['buy iphone 13 TX'], language='en', region='us').then(response => { console.log(response); }); ``` -------------------------------- ### Retrieve Trustpilot Business Data Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Trustpilot Scraper.md Fetch data for specific Trustpilot business profiles using the client instance. ```javascript // Search data from Trustpilot businesses: client.trustpilot(['outscraper.com']).then(response => { console.log(response); });; ``` -------------------------------- ### Perform Google Search (SERP) Source: https://context7.com/outscraper/outscraper-node/llms.txt Retrieve search results from Google based on search queries. Supports standard search and news search, with options for pagination, language, and region. ```javascript // Search for Google SERP results client.googleSearch(['buy iphone 13 TX'], pagesPerQuery=1, uule='', language='en', region='us').then(response => { console.log(response); }); ``` ```javascript // Search news results client.googleSearchNews(['technology news'], pagesPerQuery=2, uule='', tbs='', language='en', region='us').then(response => { console.log(response); }); ``` -------------------------------- ### Search Amazon Products and Reviews Source: https://context7.com/outscraper/outscraper-node/llms.txt Use this to search for Amazon products and scrape their reviews. Specify search terms, limits, domain, and postal code for product searches, and ASIN, limits, and sorting for reviews. ```javascript // Search Amazon products client.amazonProducts( ['wireless headphones'], limit=24, domain='amazon.com', postalCode='11201' ).then(response => { console.log(response); }); // Get Amazon product reviews client.amazonReviews( ['B08N5WRWNW'], // ASIN limit=10, sort='helpful', filterByReviewer='all_reviews', filterByStar='all_stars', domain='amazon.com' ).then(response => { console.log(response); }); ``` -------------------------------- ### Search Contacts from Website Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Contacts And Leads.md Retrieve contact information for a list of domains using the contactsAndLeads method. ```javascript # Search contacts from website: client.contactsAndLeads(['outscraper.com']).then(response => { console.log(response); }); ``` -------------------------------- ### Scrape YouTube Video Comments Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Youtube Comments Scraper.md Use the initialized client to fetch comments from a YouTube video URL. Requires a valid API key. ```javascript client.youtubeComments(['https://www.youtube.com/watch?v=ph5pHgklaZ0']).then(response => { console.log(response); });; ``` -------------------------------- ### Search Businesses with Enrichments (JSON Object Mapping) Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Businesses.md Map pre-existing JSON request parameters, including filters, limit, fields, and enrichments, to the positional arguments for the businessesSearch method. ```javascript const params = { filters: { country_code: 'US', states: ['CA', 'NY'], types: ['restaurant', 'cafe'], }, limit: 25, cursor: null, include_total: false, fields: ['name', 'types', 'address', 'country', 'website', 'phone', 'rating', 'reviews'], enrichments: { contacts_n_leads: { contacts_per_company: 4, emails_per_contact: 2 }, company_insights: {}, }, query: 'Find hotels in California and Illinois with rating 4.2+ and status operational. ' 'Return fields: name, address, rating and reviews. Limit results to 6. ' 'Enrich data with contacts_n_leads. Contact per company set to 8', }; client.businessesSearch( params.filters, params.limit, params.include_total, params.cursor, params.fields, false, // asyncRequest false, // ui null, // webhook params.query, params.enrichments ).then((response) => { console.log(response); }); ``` -------------------------------- ### Search Businesses Using JSON Filters Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Businesses.md Perform a business search using structured JSON filters for country, states, cities, types, and operational status. Specify fields to retrieve and optionally include total count or use a cursor for pagination. ```javascript client.businessesSearch( { country_code: 'US', states: ['NY'], cities: ['New York', 'Buffalo'], types: ['restaurant', 'cafe'], has_website: true, has_phone: true, business_statuses: ['operational'], }, 100, // limit false, // includeTotal null, // cursor ['name', 'phone', 'website', 'address', 'rating', 'reviews'], // fields false // asyncRequest ).then(response => { console.log(response); }); ``` -------------------------------- ### Search Contacts from Website Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Emails And Contacts.md Retrieve contact information for a list of domains using the emailsAndContacts method. ```javascript # Search contacts from website: client.emailsAndContacts(['outscraper.com']).then(response => { console.log(response); }); ``` -------------------------------- ### Scrape Places by Place IDs Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Google Maps.md Scrape data for multiple places using their respective place IDs. The limit parameter restricts the number of places fetched per query. Logs the name and place_id of each retrieved place. ```javascript client.googleMapsSearch( ["ChIJ8ccnM7dbwokRy-pTMsdgvS4", "ChIJN5X_gWdZwokRck9rk2guJ1M", "ChIJxWLy8DlawokR1jvfXUPSTUE"], limit=1, // limit of palces per each query ).then(response => { response.forEach(queryPlaces => { queryPlaces.forEach(place => { console.log('--------------------'); console.log('name: ', place.name); console.log('place_id: ', place.place_id); }); }); }); ``` -------------------------------- ### Find Company Websites Source: https://context7.com/outscraper/outscraper-node/llms.txt Find company websites from company names. Provide a list of company names to search for their corresponding websites. ```javascript client.companyWebsitesFinder(['Outscraper', 'Google']).then(response => { console.log(response); }); ``` -------------------------------- ### Search Yellow Pages Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Yellow Pages Search Scraper.md Execute a search query for businesses on Yellow Pages using the initialized client. ```javascript // Search results from Yellow Pages: client.yellowpagesSearch(['restaurants']).then(response => { console.log(response); });; ``` -------------------------------- ### Scrape Places by Multiple Queries Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Google Maps.md Scrape places by providing multiple search queries. The limit applies to the number of places per query. Iterates through results to log details like query, name, phone, and site. ```javascript client.googleMapsSearch( ['restaurants brooklyn usa', 'bars brooklyn usa'], limit=50, // limit of palces per each query language='en', region='US', ).then(response => { response.forEach(queryPlaces => { queryPlaces.forEach(place => { console.log('--------------------'); console.log('query: ', place.query); console.log('name: ', place.name); console.log('phone: ', place.phone); console.log('site: ', place.site); }); }); }); ``` -------------------------------- ### Search Businesses by Location Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Google Maps.md Search for businesses in a specific location, such as 'restaurants brooklyn usa'. Specify the limit and language for the search. ```javascript client.googleMapsSearch(['restaurants brooklyn usa'], limit=20, language='en', region='us').then(response => { console.log(response); }); ``` -------------------------------- ### Search Businesses with Enrichments (Object Format) Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Businesses.md Request additional datasets like Contacts & Leads or Company Insights alongside business results using the enrichments parameter in object format. ```javascript client.businessesSearch( { country_code: 'US', states: ['NY'], types: ['restaurant', 'cafe'], business_statuses: ['operational'], }, 25, // limit false, // includeTotal null, // cursor ['name', 'website', 'phone'], // fields false, // asyncRequest false, // ui null, // webhook null, // query { contacts_n_leads: { contacts_per_company: 3, emails_per_contact: 1, }, company_insights: {}, } // enrichments ).then(response => { console.log(response); }); ``` -------------------------------- ### Scrape Glassdoor Reviews Source: https://context7.com/outscraper/outscraper-node/llms.txt Scrape employee reviews from Glassdoor. Provide the review URL and configure limits, sorting, and cutoff options. ```javascript client.getGlassdoorReviews( ['https://www.glassdoor.com/Reviews/example'], limit=100, sort='DATE', cutoff=null ).then(response => { console.log(response); }); ``` -------------------------------- ### Find Company Websites Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Company Website Finder.md Use the companyWebsitesFinder method to retrieve website information for a given business name. Requires an initialized Outscraper client. ```javascript client.companyWebsitesFinder(['Apple Inc']).then(response => { console.log(response); });; ``` -------------------------------- ### Retrieve business details by ID Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Businesses.md Fetches specific business attributes using a unique business ID. Ensure the client is initialized before calling this method. ```js client.businessesGet( 'YOUR_BUSINESS_ID', ['name', 'phone', 'website', 'address', 'rating', 'reviews'], false ).then(response => { console.log(response); }); ``` -------------------------------- ### Extract G2 Reviews Source: https://context7.com/outscraper/outscraper-node/llms.txt Extract reviews from G2 software review platform. Provide the review URL and specify the limit and sorting preference. ```javascript client.g2Reviews(['https://www.g2.com/products/example/reviews'], limit=100, sort='').then(response => { console.log(response); }); ``` -------------------------------- ### Iterate Over All Business Search Results Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Businesses.md Automatically paginate through all business search results using the businessesIterSearch iterator. Supports filters, queries, and enrichments. ```javascript (async () => { const filters = { country_code: 'US', states: ['NY'], business_statuses: ['operational'] }; // You can also pass `query` and/or `enrichments` here: const query = null; const enrichments = { contacts_n_leads: { contacts_per_company: 2, emails_per_contact: 1 }, }; for await (const item of client.businessesIterSearch( filters, 100, // limit ['name', 'phone', 'address', 'rating', 'reviews'], // fields false, // includeTotal query, enrichments )) { console.log(item.name, item.phone); } })(); ``` -------------------------------- ### Fetch Company Insights Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Company Insights.md Retrieve company information by passing a list of domains to the companyInsights method. ```javascript // Get information about the companies: client.companyInsights(['outscraper.com']).then(response => { console.log(response); });; ``` -------------------------------- ### Scrape TripAdvisor Reviews Source: https://context7.com/outscraper/outscraper-node/llms.txt Scrape reviews directly from TripAdvisor listings. Provide the URL of the TripAdvisor listing and specify the desired limit for the number of reviews. ```javascript client.tripadvisorReviews(['https://www.tripadvisor.com/Restaurant_Review-g60763-example'], limit=100).then(response => { console.log(response); }); ``` -------------------------------- ### Scrape Address Information Source: https://context7.com/outscraper/outscraper-node/llms.txt Look up information from addresses using Whitepages. Provide a list of addresses to query. ```javascript client.addressScraper(['1600 Amphitheatre Parkway, Mountain View, CA']).then(response => { console.log(response); }); ``` -------------------------------- ### POST /businesses Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Businesses.md Search for business records using structured filters, AI queries, or both. Supports optional data enrichment and field selection. ```APIDOC ## POST /businesses ### Description Retrieve business records using JSON filters or AI-powered plain text queries. When both are provided, filters and fields are merged, while plain text query parameters take priority for limit, cursor, and include_total. ### Method POST ### Endpoint /businesses ### Parameters #### Request Body - **filters** (object) - Optional - Structured search criteria (e.g., country_code, states, cities, types, business_statuses). - **limit** (integer) - Optional - Maximum number of results to return. - **include_total** (boolean) - Optional - Whether to include the total count of results. - **cursor** (string) - Optional - Pagination cursor. - **fields** (array) - Optional - List of fields to return (e.g., name, phone, website, rating). - **asyncRequest** (boolean) - Optional - Whether to perform the request asynchronously. - **ui** (boolean) - Optional - UI flag. - **webhook** (string) - Optional - Webhook URL for notifications. - **query** (string) - Optional - AI-powered plain text search query. - **enrichments** (object) - Optional - Additional datasets to request (e.g., contacts_n_leads, company_insights). ### Request Example { "filters": { "country_code": "US", "states": ["NY"], "types": ["restaurant"] }, "limit": 25, "fields": ["name", "website"] } ### Response #### Success Response (200) - **data** (array) - List of business records matching the criteria. #### Response Example { "data": [ { "name": "Example Restaurant", "website": "https://example.com" } ] } ``` -------------------------------- ### Extract Capterra Reviews Source: https://context7.com/outscraper/outscraper-node/llms.txt Extract reviews from Capterra software review platform. Provide the product review URL and set limits, sorting, cutoff, and language. ```javascript client.capterraReviews( ['https://www.capterra.com/p/example/reviews'], limit=100, sort='', cutoff=null, language='en' ).then(response => { console.log(response); }); ``` -------------------------------- ### Combined JSON and Plain Text Search Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Businesses.md Execute a search using both JSON filters and a plain text query. Filters and fields from both sources are merged, with plain text having priority for limit, cursor, and include_total. ```javascript client.businessesSearch( { country_code: 'US', states: ['NY'], has_website: true, }, 10, // default limit (plain text can override) false, null, ['name', 'website'], // JSON fields (merged with AI fields) false, false, null, 'In Buffalo, show 50 restaurants with phone and rating. Include reviews.' ).then(response => { console.log(response); }); ``` -------------------------------- ### Retrieve Company Insights Source: https://context7.com/outscraper/outscraper-node/llms.txt Fetches detailed corporate data such as revenue, employee count, and founding year. ```javascript client.companyInsights(['outscraper.com']).then(response => { console.log(response); }); // With specific fields and enrichments client.companyInsights(['outscraper.com', 'google.com'], fields='', asyncRequest=false, enrichments=[]).then(response => { response.forEach(company => { console.log('Company:', company.name); console.log('Revenue:', company.revenue); console.log('Employees:', company.employees); }); }); ``` -------------------------------- ### Search and Retrieve Business Data Source: https://context7.com/outscraper/outscraper-node/llms.txt Provides multiple methods to query the business database, including structured filters, AI-powered natural language queries, and auto-pagination. ```javascript // Search using JSON filters client.businessesSearch( { country_code: 'US', states: ['NY'], cities: ['New York', 'Buffalo'], types: ['restaurant', 'cafe'], has_website: true, has_phone: true, business_statuses: ['operational'], }, limit=100, includeTotal=false, cursor=null, fields=['name', 'phone', 'website', 'address', 'rating', 'reviews'], asyncRequest=false ).then(response => { console.log(response); }); // AI-powered plain text search client.businessesSearch( {}, limit=10, includeTotal=false, cursor=null, fields=null, asyncRequest=false, ui=false, webhook=null, query='Find cafes in New York, NY. Limit 25. Return name, address, phone, website, rating and reviews.' ).then(response => { console.log(response); }); // Search with enrichments (contacts & leads, company insights) client.businessesSearch( { country_code: 'US', states: ['NY'], types: ['restaurant'] }, limit=25, includeTotal=false, cursor=null, fields=['name', 'website', 'phone'], asyncRequest=false, ui=false, webhook=null, query=null, enrichments={ contacts_n_leads: { contacts_per_company: 3, emails_per_contact: 1 }, company_insights: {} } ).then(response => { console.log(response); }); // Iterate over all results with auto-pagination (async () => { for await (const item of client.businessesIterSearch( { country_code: 'US', states: ['NY'], business_statuses: ['operational'] }, limit=100, fields=['name', 'phone', 'address', 'rating', 'reviews'] )) { console.log(item.name, item.phone); } })(); // Get specific business by ID client.businessesGet('YOUR_BUSINESS_ID', ['name', 'phone', 'website', 'address']).then(response => { console.log(response); }); ``` -------------------------------- ### Scrape Tripadvisor Reviews Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Tripadvisor Reviews Scraper.md Retrieve reviews for a specific business URL using the tripadvisorReviews method. ```javascript // Get information about business: client.tripadvisorReviews(['https://www.tripadvisor.com Restaurant_Review-g187147-d12947099-Reviews-Mayfair_Garden-Paris_Ile_de_France.html']).then(response => { console.log(response); });; ``` -------------------------------- ### Retrieve Google Maps Photos Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Google Maps Photos Scraper.md Fetch photos for a specific place using the getGoogleMapsPhotos method. ```javascript // Get information about the places photos: client.getGoogleMapsPhotos(['The NoMad Restaurant, NY, USA']).then(response => { console.log(response); });; ``` -------------------------------- ### Extract App Store Reviews Source: https://context7.com/outscraper/outscraper-node/llms.txt Extract reviews from Apple App Store apps. Provide the app's URL and set limits, sorting, and cutoff options. ```javascript client.appStoreReviews( ['https://apps.apple.com/app/example'], limit=100, sort='mosthelpful', cutoff=null ).then(response => { console.log(response); }); ``` -------------------------------- ### AI-Powered Plain Text Search Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Businesses.md Perform a business search using an AI-powered plain text query. Optional parameters like filters, limit, and fields can be provided, but the plain text query has priority for certain settings like limit. ```javascript client.businessesSearch( {}, // filters (optional) 10, // limit (optional, may be overridden by plain text) false, // includeTotal null, // cursor null, // fields (optional, can be merged with AI result) false, // asyncRequest false, // ui null, // webhook 'Find cafes in New York, NY. Limit 25. Return name, address, phone, website, rating and reviews.' ).then(response => { console.log(response); }); ``` -------------------------------- ### Retrieve Google Maps Directions Source: https://context7.com/outscraper/outscraper-node/llms.txt Fetches travel information between specified origin and destination pairs. ```javascript client.googleMapsDirections( [['New York, NY', 'Los Angeles, CA']], // origin-destination pairs departureTime=null, finishTime=null, interval=null, travelMode='best', language='en', region='us' ).then(response => { console.log(response); }); ``` -------------------------------- ### Scrape Google Maps Reviews Source: https://github.com/outscraper/outscraper-node/blob/main/examples/Google Maps Reviews.md Various methods to retrieve reviews by place ID or search query, including filtering by date and limiting results. ```javascript // Get reviews of the specific place by id client.googleMapsReviews(['ChIJrc9T9fpYwokRdvjYRHT8nI4'], reviewsLimit=20, language='en').then(response => { console.log(response); }); // Get reviews for places found by search query client.googleMapsReviews(['Memphis Seoul brooklyn usa'], reviewsLimit=20, limit=20, language='en').then(response => { console.log(response); }); // Get only new reviews during last 24 hours const yesterdayTimestamp = 1657980986 client.googleMapsReviews(['ChIJrc9T9fpYwokRdvjYRHT8nI4'], sort='newest', cutoff=yesterdayTimestamp, reviewsLimit=100, language='en').then(response => { console.log(response); }); // Scrap Places Reviews by Place Ids client.googleMapsReviews( ["ChIJN5X_gWdZwokRck9rk2guJ1M", "ChIJxWLy8DlawokR1jvfXUPSTUE"], reviewsLimit=20, // limit of reviews per each place limit=1 // limit of palces per each query ).then(response => { response.forEach(place => { console.log('--------------------'); console.log('name: ', place.name); place.reviews_data.forEach(review => { console.log('review: ', review.review_text); }); }); }); // Scrap Only New Reviews client.googleMapsReviews( ["ChIJN5X_gWdZwokRck9rk2guJ1M", "ChIJxWLy8DlawokR1jvfXUPSTUE"], reviewsLimit=100, limit=1, sort='newest', cutoff=1654596109, // the maximum timestamp value for reviews (oldest review you want to extract). Can be used to scrape only the new reviews since your latest update ).then(response => { response.forEach(place => { console.log('--------------------'); console.log('name: ', place.name); console.log('new reviews: ', place.reviews_data.length); }); }); ``` -------------------------------- ### Extract Emails and Contacts Source: https://context7.com/outscraper/outscraper-node/llms.txt Retrieves contact information and social links from provided domains or websites. ```javascript // Search contacts from website client.emailsAndContacts(['outscraper.com']).then(response => { console.log(response); }); // Get detailed contacts and leads with preferences client.contactsAndLeads( ['outscraper.com'], fields=null, asyncRequest=true, preferredContacts=['CEO', 'CTO', 'Marketing'], contactsPerCompany=3, emailsPerContact=1, skipContacts=0, generalEmails=false ).then(response => { console.log(response); }); ``` -------------------------------- ### Geocoding and Reverse Geocoding Source: https://context7.com/outscraper/outscraper-node/llms.txt Convert addresses to coordinates and vice versa. ```APIDOC ## GET /geocoding ### Description Convert addresses to coordinates (Forward Geocoding) or coordinates to addresses (Reverse Geocoding). ### Parameters #### Request Body - **locations** (array) - Required - List of addresses or coordinates ``` -------------------------------- ### Emails and Contacts Source: https://context7.com/outscraper/outscraper-node/llms.txt Extract email addresses, social links, and phone numbers from websites. ```APIDOC ## GET /emailsAndContacts ### Description Extract email addresses, social links, and phone numbers from websites and domains. ### Parameters #### Request Body - **domains** (array) - Required - List of domains to scrape ``` -------------------------------- ### Validate Email Addresses Source: https://context7.com/outscraper/outscraper-node/llms.txt Checks the deliverability status of provided email addresses. ```javascript client.validateEmails(['test@example.com', 'contact@outscraper.com']).then(response => { console.log(response); }); ``` -------------------------------- ### Google Maps Search API Source: https://context7.com/outscraper/outscraper-node/llms.txt Use the `googleMapsSearch` method to find businesses and places on Google Maps using queries or place IDs. It returns detailed business information. ```APIDOC ## Google Maps Search Search for businesses and places on Google Maps by query strings or place IDs. Returns detailed business information including name, address, phone, website, ratings, and more. ### Method `client.googleMapsSearch(queries, options)` ### Parameters - **queries** (string[] | string) - Required - A list of search queries or place IDs. - **options** (object) - Optional - Configuration for the search. - **limit** (number) - Optional - Maximum number of results per query. - **language** (string) - Optional - Language for the search results (e.g., 'en'). - **region** (string) - Optional - Region for the search (e.g., 'us'). ### Request Example ```js // Search for businesses in specific locations client.googleMapsSearch(['restaurants brooklyn usa'], { limit: 20, language: 'en', region: 'us' }).then(response => { console.log(response); }); // Get data of specific places by Place IDs client.googleMapsSearch( ["ChIJ8ccnM7dbwokRy-pTMsdgvS4", "ChIJN5X_gWdZwokRck9rk2guJ1M"], { limit: 1 } ).then(response => { response.forEach(queryPlaces => { queryPlaces.forEach(place => { console.log('name:', place.name); console.log('phone:', place.phone); console.log('site:', place.site); console.log('rating:', place.rating); }); }); }); // Using async/await const response = await client.googleMapsSearch( ['restaurants brooklyn usa', 'bars brooklyn usa'], { limit: 50, language: 'en', region: 'US' } ); ``` ### Response Example (Response structure varies based on the query and data availability. See library documentation for full details.) ``` -------------------------------- ### Google Maps Reviews API Source: https://context7.com/outscraper/outscraper-node/llms.txt Scrape reviews from Google Maps places using `googleMapsReviews`. Supports filtering by date, sorting, and pagination. ```APIDOC ## Google Maps Reviews Scrape reviews from Google Maps places. Supports filtering by date, sorting, and pagination for extracting large volumes of reviews. ### Method `client.googleMapsReviews(queries, options)` ### Parameters - **queries** (string[] | string) - Required - A list of search queries or place IDs. - **options** (object) - Optional - Configuration for scraping reviews. - **reviewsLimit** (number) - Optional - Maximum number of reviews to scrape per place. - **limit** (number) - Optional - Maximum number of places to process. - **language** (string) - Optional - Language for the reviews (e.g., 'en'). - **sort** (string) - Optional - Sorting order for reviews ('newest', 'most_relevant'). - **cutoff** (number) - Optional - Unix timestamp to filter reviews posted after this time. - **asyncRequest** (boolean) - Optional - Enable asynchronous request mode. ### Request Example ```js // Get reviews of specific place by ID client.googleMapsReviews(['ChIJrc9T9fpYwokRdvjYRHT8nI4'], { reviewsLimit: 20, language: 'en' }).then(response => { console.log(response); }); // Get reviews for places found by search query client.googleMapsReviews(['Memphis Seoul brooklyn usa'], { reviewsLimit: 20, limit: 20, language: 'en' }).then(response => { console.log(response); }); // Get only new reviews since a specific timestamp (cutoff filter) const yesterdayTimestamp = 1657980986; client.googleMapsReviews( ['ChIJrc9T9fpYwokRdvjYRHT8nI4'], { reviewsLimit: 100, sort: 'newest', cutoff: yesterdayTimestamp } ).then(response => { response.forEach(place => { console.log('name:', place.name); place.reviews_data.forEach(review => { console.log('review:', review.review_text); console.log('rating:', review.review_rating); }); }); }); ``` ### Response Example (Response structure includes place details and a list of reviews. See library documentation for full details.) ``` -------------------------------- ### Extract Google Play Reviews Source: https://context7.com/outscraper/outscraper-node/llms.txt Extract reviews from Google Play Store apps. Provide the app's package name and configure limits, sorting, cutoff, rating, and language. ```javascript client.googlePlayReviews( ['com.example.app'], // App package name reviewsLimit=100, sort='most_relevant', cutoff=null, rating=null, language='en' ).then(response => { console.log(response); }); ``` -------------------------------- ### Google Search (SERP) API Source: https://context7.com/outscraper/outscraper-node/llms.txt Retrieve search engine results pages (SERP) from Google using `googleSearch`. Supports organic results, ads, and news results. ```APIDOC ## Google Search (SERP) Retrieve search results from Google based on search queries. Returns organic results, ads, and other SERP features. ### Method `client.googleSearch(queries, options)` ### Parameters - **queries** (string[] | string) - Required - Search queries. - **options** (object) - Optional - Configuration for the search. - **pagesPerQuery** (number) - Optional - Number of pages to scrape per query. - **uule** (string) - Optional - Specifies the location for the search. - **language** (string) - Optional - Language for the search results (e.g., 'en'). - **region** (string) - Optional - Region for the search (e.g., 'us'). - **tbs** (string) - Optional - Time-based search parameter (e.g., for news). ### Request Example ```js // Search for Google SERP results client.googleSearch(['buy iphone 13 TX'], { pagesPerQuery: 1, uule: '', language: 'en', region: 'us' }).then(response => { console.log(response); }); // Search news results client.googleSearchNews(['technology news'], { pagesPerQuery: 2, uule: '', tbs: '', language: 'en', region: 'us' }).then(response => { console.log(response); }); ``` ### Response Example (Response structure contains SERP data including organic results, ads, etc. See library documentation for full details.) ``` -------------------------------- ### Search Yelp Businesses and Reviews Source: https://context7.com/outscraper/outscraper-node/llms.txt Search for businesses on Yelp and extract their reviews. Provide search terms and limits for business searches, and Yelp review URLs, limits, and cursors for review extraction. ```javascript // Search Yelp businesses client.yelpSearch(['restaurants brooklyn'], limit=100).then(response => { console.log(response); }); // Get Yelp reviews client.yelpReviews(['https://www.yelp.com/biz/example'], limit=100, cursor='', sort='relevance_desc').then(response => { console.log(response); }); ``` -------------------------------- ### Perform Geocoding Operations Source: https://context7.com/outscraper/outscraper-node/llms.txt Converts between physical addresses and geographic coordinates. ```javascript // Forward geocoding (address to coordinates) client.geocoding(['1600 Amphitheatre Parkway, Mountain View, CA']).then(response => { console.log(response); }); // Reverse geocoding (coordinates to address) client.reverseGeocoding(['37.4224764,-122.0842499']).then(response => { console.log(response); }); ``` -------------------------------- ### Businesses Search Source: https://context7.com/outscraper/outscraper-node/llms.txt Search for businesses using structured filters, AI-powered queries, or retrieve specific business details. ```APIDOC ## GET /businessesSearch ### Description Search the Outscraper database for businesses using structured filters or AI-powered natural language queries. ### Parameters #### Request Body - **filters** (object) - Required - JSON filters for search - **limit** (number) - Optional - Result limit - **fields** (array) - Optional - Fields to return - **query** (string) - Optional - AI-powered plain text search query - **enrichments** (object) - Optional - Data enrichment options ```