<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Pavan A M</title>
    <description>The latest articles on DEV Community by Pavan A M (@pavan_am_a8b37b51bf1357b).</description>
    <link>https://dev.to/pavan_am_a8b37b51bf1357b</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3807716%2F69b95494-ea8c-4daf-b453-e5b682cf905c.webp</url>
      <title>DEV Community: Pavan A M</title>
      <link>https://dev.to/pavan_am_a8b37b51bf1357b</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pavan_am_a8b37b51bf1357b"/>
    <language>en</language>
    <item>
      <title>How I Built a Chrome Extension to Extract ChatGPT Search Queries</title>
      <dc:creator>Pavan A M</dc:creator>
      <pubDate>Thu, 05 Mar 2026 10:38:06 +0000</pubDate>
      <link>https://dev.to/pavan_am_a8b37b51bf1357b/how-i-built-a-chrome-extension-to-extract-chatgpt-search-queries-3oo5</link>
      <guid>https://dev.to/pavan_am_a8b37b51bf1357b/how-i-built-a-chrome-extension-to-extract-chatgpt-search-queries-3oo5</guid>
      <description>&lt;p&gt;

&lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://chromewebstore.google.com/detail/chatgpt-query-extractor/cocgimelkbknadhaioallelibljhleek?hl=en" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh3.googleusercontent.com%2Ftw07wPvploPRswLnB953HxyCZcorkMunRm3bPH0Jy3t0tSDiZJoNaBGVcV9rpmsokSFVM3l_Gc0JkrDvF2agpNRvUQ%3Ds128-rj-sc0x00ffffff" height="auto" class="m-0"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://chromewebstore.google.com/detail/chatgpt-query-extractor/cocgimelkbknadhaioallelibljhleek?hl=en" rel="noopener noreferrer" class="c-link"&gt;
            ChatGPT Query Extractor - Chrome Web Store
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            Auto-send prompts to ChatGPT and capture the internal search queries it generates
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fssl.gstatic.com%2Fchrome%2Fwebstore%2Fimages%2Ficon_48px.png"&gt;
          chromewebstore.google.com
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;




&lt;p&gt;AI chat tools like ChatGPT have changed how people search for information. Instead of typing multiple search queries into Google, users now ask one question and let AI generate answers.&lt;/p&gt;

&lt;p&gt;But something interesting happens behind the scenes.&lt;/p&gt;

&lt;p&gt;AI systems often generate multiple internal search queries to gather relevant information before producing an answer. These queries are usually hidden from users.&lt;/p&gt;

&lt;p&gt;So I built a Chrome extension called ChatGPT Query Extractor to capture and analyze these hidden queries.&lt;/p&gt;

&lt;p&gt;This article explains why I built it, how it works, and some of the technical implementation details.&lt;/p&gt;

&lt;p&gt;The Idea&lt;/p&gt;

&lt;p&gt;While using AI tools for research and SEO, I noticed that AI models often generate several variations of search queries internally.&lt;/p&gt;

&lt;p&gt;For example, if a user asks:&lt;/p&gt;

&lt;p&gt;How can startups improve SEO using AI?&lt;/p&gt;

&lt;p&gt;The AI might internally generate queries like:&lt;/p&gt;

&lt;p&gt;AI SEO strategies for startups&lt;/p&gt;

&lt;p&gt;tools for generative engine optimization&lt;/p&gt;

&lt;p&gt;how AI search works in ChatGPT&lt;/p&gt;

&lt;p&gt;These query variations are useful for:&lt;/p&gt;

&lt;p&gt;SEO research&lt;/p&gt;

&lt;p&gt;understanding AI search behavior&lt;/p&gt;

&lt;p&gt;content strategy planning&lt;/p&gt;

&lt;p&gt;analyzing generative engine optimization (GEO)&lt;/p&gt;

&lt;p&gt;However, most AI interfaces do not expose these queries.&lt;/p&gt;

&lt;p&gt;That’s where the idea for ChatGPT Query Extractor came from.&lt;/p&gt;

&lt;p&gt;What the Extension Does&lt;/p&gt;

&lt;p&gt;The extension helps users capture and analyze AI-generated queries during conversations.&lt;/p&gt;

&lt;p&gt;Key features include:&lt;/p&gt;

&lt;p&gt;Extract hidden search queries generated during AI responses&lt;/p&gt;

&lt;p&gt;Display captured queries in the browser extension popup&lt;/p&gt;

&lt;p&gt;Export queries for research or SEO analysis&lt;/p&gt;

&lt;p&gt;Work directly inside the browser without external servers&lt;/p&gt;

&lt;p&gt;The goal is to help researchers, developers, and marketers understand how AI systems generate search queries.&lt;/p&gt;

&lt;p&gt;Technical Approach&lt;/p&gt;

&lt;p&gt;The extension is built using Chrome Extension Manifest V3 and relies on several core components.&lt;/p&gt;

&lt;p&gt;Main components:&lt;/p&gt;

&lt;p&gt;Manifest configuration&lt;/p&gt;

&lt;p&gt;Content scripts&lt;/p&gt;

&lt;p&gt;Background service worker&lt;/p&gt;

&lt;p&gt;Browser storage API&lt;/p&gt;

&lt;p&gt;These components work together to observe page updates and capture relevant query information.&lt;/p&gt;

&lt;p&gt;Extension Manifest Example&lt;/p&gt;

&lt;p&gt;Every Chrome extension starts with a manifest file that defines the extension configuration and permissions.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;{&lt;br&gt;
  "manifest_version": 3,&lt;br&gt;
  "name": "ChatGPT Query Extractor",&lt;br&gt;
  "version": "1.0",&lt;br&gt;
  "description": "Extract AI generated search queries from chat interfaces",&lt;br&gt;
  "permissions": [&lt;br&gt;
    "storage",&lt;br&gt;
    "activeTab"&lt;br&gt;
  ],&lt;br&gt;
  "background": {&lt;br&gt;
    "service_worker": "background.js"&lt;br&gt;
  }&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;The manifest file specifies:&lt;/p&gt;

&lt;p&gt;extension name&lt;/p&gt;

&lt;p&gt;permissions&lt;/p&gt;

&lt;p&gt;background scripts&lt;/p&gt;

&lt;p&gt;browser actions&lt;/p&gt;

&lt;p&gt;Detecting AI Responses&lt;/p&gt;

&lt;p&gt;To capture queries generated during AI responses, the extension monitors the webpage for changes.&lt;/p&gt;

&lt;p&gt;This is done using a MutationObserver, which detects when new content is added to the page.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;const observer = new MutationObserver((mutations) =&amp;gt; {&lt;br&gt;
  mutations.forEach((mutation) =&amp;gt; {&lt;br&gt;
    console.log("New AI response detected");&lt;br&gt;
  });&lt;br&gt;
});&lt;/p&gt;

&lt;p&gt;observer.observe(document.body, {&lt;br&gt;
  childList: true,&lt;br&gt;
  subtree: true&lt;br&gt;
});&lt;/p&gt;

&lt;p&gt;Whenever new content appears in the chat interface, the extension scans it to identify possible search queries.&lt;/p&gt;

&lt;p&gt;Sending Data to the Background Script&lt;/p&gt;

&lt;p&gt;Once a query is detected, it is sent to the background script for processing.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;chrome.runtime.sendMessage({&lt;br&gt;
  type: "NEW_QUERY",&lt;br&gt;
  query: extractedQuery&lt;br&gt;
});&lt;/p&gt;

&lt;p&gt;The background script receives this data and stores it locally.&lt;/p&gt;

&lt;p&gt;Storing Extracted Queries&lt;/p&gt;

&lt;p&gt;The extension uses the Chrome Storage API to save extracted queries inside the browser.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;chrome.storage.local.set({&lt;br&gt;
  queries: queryList&lt;br&gt;
});&lt;/p&gt;

&lt;p&gt;This allows users to review the queries later or export them for further analysis.&lt;/p&gt;

&lt;p&gt;Privacy Considerations&lt;/p&gt;

&lt;p&gt;Because the extension interacts with AI chat interfaces, privacy is an important concern.&lt;/p&gt;

&lt;p&gt;To address this:&lt;/p&gt;

&lt;p&gt;Queries are stored locally in the browser&lt;/p&gt;

&lt;p&gt;No external servers are required&lt;/p&gt;

&lt;p&gt;Users control when and how data is exported&lt;/p&gt;

&lt;p&gt;This design keeps the extension lightweight and privacy-focused.&lt;/p&gt;

&lt;p&gt;Potential Use Cases&lt;/p&gt;

&lt;p&gt;There are several practical uses for extracting AI-generated queries.&lt;/p&gt;

&lt;p&gt;These include:&lt;/p&gt;

&lt;p&gt;SEO Research&lt;br&gt;
Understanding what queries AI considers relevant for a topic.&lt;/p&gt;

&lt;p&gt;Content Strategy&lt;br&gt;
Discovering new keyword variations for blog posts and articles.&lt;/p&gt;

&lt;p&gt;AI Behavior Analysis&lt;br&gt;
Studying how AI systems break down complex questions.&lt;/p&gt;

&lt;p&gt;Developer Research&lt;br&gt;
Exploring how AI tools generate internal queries.&lt;/p&gt;

&lt;p&gt;Try the Extension&lt;/p&gt;

&lt;p&gt;If you want to explore how AI generates search queries, you can try the extension here:&lt;/p&gt;

&lt;p&gt;Chrome Web Store&lt;br&gt;


&lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://chromewebstore.google.com/detail/chatgpt-query-extractor/cocgimelkbknadhaioallelibljhleek" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh3.googleusercontent.com%2Ftw07wPvploPRswLnB953HxyCZcorkMunRm3bPH0Jy3t0tSDiZJoNaBGVcV9rpmsokSFVM3l_Gc0JkrDvF2agpNRvUQ%3Ds128-rj-sc0x00ffffff" height="auto" class="m-0"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://chromewebstore.google.com/detail/chatgpt-query-extractor/cocgimelkbknadhaioallelibljhleek" rel="noopener noreferrer" class="c-link"&gt;
            ChatGPT Query Extractor - Chrome Web Store
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            Auto-send prompts to ChatGPT and capture the internal search queries it generates
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fssl.gstatic.com%2Fchrome%2Fwebstore%2Fimages%2Ficon_48px.png"&gt;
          chromewebstore.google.com
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;




&lt;p&gt;Project Website&lt;br&gt;


&lt;/p&gt;
&lt;div class="ltag-netlify"&gt;
  &lt;iframe src="https://gptqueryextractor.netlify.app/" title="Netlify embed"&gt;
  &lt;/iframe&gt;
&lt;/div&gt;




&lt;p&gt;Final Thoughts&lt;/p&gt;

&lt;p&gt;AI-powered search is changing how people discover information. Understanding how these systems generate queries can provide valuable insights for developers, researchers, and marketers.&lt;/p&gt;

&lt;p&gt;Tools like ChatGPT Query Extractor make it easier to analyze these hidden processes and explore how AI-assisted search works.&lt;/p&gt;

&lt;p&gt;As AI tools continue evolving, analyzing query generation may become an important part of understanding modern search behavior.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
