Skip to main content

Overview

This guide demonstrates how to use Olostep’s Batches endpoint to fetch data from popular AI search tools including Google AI Mode, Gemini, Microsoft Copilot, ChatGPT, Perplexity, and Google AI Overview. By leveraging specialized parsers for each platform, you can extract structured search results at scale, making it ideal for:
  • Competitive intelligence gathering
  • Multi-platform search result comparison
  • AI search engine monitoring

Request Formulation

Step 1: Prepare Your Queries

Create an array of queries you want to search. For this demo, we’ll query news across different cities:
const axios = require('axios');

// Configuration
const CONFIG = {
  url: 'https://api.olostep.com/v1/batches',
  token: 'YOUR_API_KEY_HERE'
};

// Demo: Generate queries for different cities
const BASE_QUERY = 'what is the news today in';
const CITIES = [
  'New York', 'Los Angeles', 'Chicago', 'Houston', 'Phoenix',
  'Philadelphia', 'San Antonio', 'San Diego', 'Dallas', 'San Jose'
];

Step 2: Generate Items for Each AI Tool

Each AI search tool requires a specific parser ID and URL structure. Below are the item generation functions for each platform:
  • Google AI Mode
  • ChatGPT
  • Perplexity
  • Google AI Overview
  • Gemini
  • Microsoft Copilot
  • Grok
Parser ID: @olostep/google-aimode-results
const generateAIModeItems = () => {
  return CITIES.map((city, index) => {
    const query = `${BASE_QUERY} ${city}`;
    const encodedQuery = encodeURIComponent(query);
    return {
      url: `https://google.com/aimode?q=${encodedQuery}`,
      custom_id: (index + 1).toString()
    };
  });
};

Step 3: Submit the Batch Request

Submit your batch request with the generated items:
const response = await axios.post(CONFIG.url, {
  parser: { id: '@olostep/gemini-results' },
  items: generateGeminiItems()
}, {
  headers: {
    'Authorization': `Bearer ${CONFIG.token}`,
    'Content-Type': 'application/json'
  }
});

const batchId = response.data.id;
Note: After submitting, poll for completion to retrieve results.

Response Format

After submitting a batch request and polling for completion, you’ll receive responses in the following format:
  • Google AI Mode
  • ChatGPT
  • Perplexity
  • Google AI Overview
  • Gemini
  • Microsoft Copilot
  • Grok
{
  "url": "https://www.google.com//search?q=what+is+the+news+today+in+Austin&hl=en&udm=50&aep=11&newwindow=1&sei=mt_oaPvDBrKh5NoPy9W1sQE&mstk=AUtExfANCngr4KIDEH7t1EJsJ3xHfdsjka647_hz7r0UJWh1VM4FhWV9j1f2QOy0ylJU2l9-zWCxfORo5WzWeAN52_oVMM7nGAgEIRdyzsjtT7h1qhBn8Qj2RiN8HFQke6uYjmqnTeR4O1opgHbiLdAe5ZNfkzDyE_9O2zE&csuir=1",
  "prompt": "what is the news today in Austin",
  "answer_markdown": "In Austin news, officials announced that progress has been made on the city's homelessness response \n\n.  \n\n**Top story: Homelessness**  \n\n* Austin officials and local advocates reported \"real, measurable progress\" in addressing the needs of the city's homeless population.\n* The announcement came ahead of a report from the Ending Community Homelessness Coalition (ECHO)... ",
  "sources": [
    {
      "url": "https://www.kxan.com/video/austin-mayor-citys-decreased-homelessness-is-a-big-deal/11151402/#:~:text=Elected%20city%20and%20county%20officials%2C%20along%20with,experiencing%20homelessness%20in%20Austin.%20Read%20More:%20https://www.kxan.com/news/local/austin/echo%2Dto%2Dpresent%2Dreport%2Don%2Dstate%2Dof%2Daustins%2Dhomelessness%2Dresponse%2Dsystem/",
      "title": "KXAN\n·",
      "description": "Austin mayor: City's decreased homelessness is 'a big deal'",
      "icon": null,
      "domain": "https://www.kxan.com",
      "cited": true
    },
    {
      "url": "https://www.fox7austin.com/tag/us/tx/travis-county/austin/east-austin#:~:text=Austin%20pd%20arrests%20man%20in%20deadly%20east%20austin%20double%20shooting",
      "title": "FOX 7 Austin",
      "description": "East Austin",
      "icon": null,
      "domain": "https://www.fox7austin.com",
      "cited": true
    },
    ...
  ],
  "country": null
}
Missing something? Reach out to info@olostep.com for support or custom implementation assistance.
I