Want to see how ChatGPT decides what to search and why? This bookmarklet I built gives you a behind-the-scenes look.
What It Does
This tool extracts:
- All grounded search queries ChatGPT used during a conversation (e.g. when browsing is enabled)
- The reasoning or “thoughts” ChatGPT had about why it searched what it did
- UPDATE: It now also extracts the titles, URLs, and snippets of all the webpages accessed in searches
It opens everything in a clean, formatted page with:
- A copy button next to each item
- A copy all option
- My favorite part: The actual internal thought process GPT used before querying Bing
Why It’s Useful
- See how GPT forms its search intent
- Audit prompt grounding for transparency
- Analyze how AI aligns its queries with your request
- Great for SEOs, prompt engineers, and content strategists
Example of the Output
Here is an example of what the output looks like from a chat I created:

How to Create a Bookmarklet (If You’ve Never Done It Before)
If you’re copying the code manually:
- Right-click your bookmarks bar and choose “Add page” (or “Add bookmark”)
- Set the Name to something like:
GPT Reasoning Extractor
- Paste the JavaScript code into the URL field
(Yes, even though it’s not a normal URL) - Save it
Now any time you’re on a ChatGPT conversation, just click that bookmarklet and it’ll instantly open the search queries and reasoning in a clean new tab.
You can also just drag and drop the link I provided below directly to your browser’s bookmark bar and it will create it automatically for you.
🧠 Try It
Drag this to your bookmark bar ==> ChatGPT Search Query and Reasoning Extractor
Or copy this into a bookmark in your browser:
javascript:(async()=>{try{const cid=location.pathname.match(/\/c\/([^/]+)/)?.[1];if(!cid)return alert("Open a ChatGPT conversation first.");const sess=await fetch("/api/auth/session").then(r=>r.json()),res=await fetch(`/backend-api/conversation/${cid}`,{headers:{Authorization:"Bearer "+sess.accessToken,"Content-Type":"application/json"}}),data=await res.json();const queries=[],thoughtsList=[];const sourcesList=[];const extractSources=obj=>{if(typeof obj!=="object"||!obj)return;if(obj.type==="search_result_group"&&Array.isArray(obj.entries)){obj.entries.forEach(entry=>{if(entry.type==="search_result"&&entry.url&&entry.title&&entry.snippet){sourcesList.push({title:entry.title,url:entry.url,snippet:entry.snippet});}});}for(const key in obj){if(key!=="entries")extractSources(obj[key]);}};extractSources(data);const extractQueries=obj=>{if(typeof obj!=="object"||!obj)return;if(Array.isArray(obj.search_queries))obj.search_queries.forEach(sq=>sq.q&&queries.push({q:sq.q}));if(obj.metadata&&Array.isArray(obj.metadata.search_queries))obj.metadata.search_queries.forEach(sq=>sq.q&&queries.push({q:sq.q}));if(obj.content_type==="thoughts"&&Array.isArray(obj.thoughts)&&obj.thoughts.length>0){obj.thoughts.forEach(t=>{if(t.content)thoughtsList.push(t.content)});}for(const key in obj)if(key!=="search_queries"&&key!=="metadata")extractQueries(obj[key])};extractQueries(data);if(queries.length===0&&thoughtsList.length===0&&sourcesList.length===0)return alert("No search queries, thoughts, or sources found.");const newTab=window.open("","_blank"),doc=newTab.document;doc.write("<!DOCTYPE html><html><head><title>ChatGPT Reasoning and Search Query Extractor</title></head><body></body></html>"),doc.close();const style=doc.createElement("style");style.textContent=`body{background:#1a1a1a;color:#f0f0f0;font-family:'Inter','Helvetica Neue',sans-serif;margin:0;padding:0;}#main-content{max-width:800px;margin:40px auto;padding:20px;}h1{font-size:24px;}button{margin-left:10px;padding:6px 10px;border:none;border-radius:4px;background:#ffd54f;color:#000;font-weight:600;cursor:pointer;}button:hover{background:#ffca28;}a{color:#ffd54f;text-decoration:none;}a:hover{text-decoration:underline;}.header{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px;flex-wrap:wrap;gap:10px;}.query,.thought{margin:10px 0;padding:10px;background:#2a2a2a;border-radius:4px;}.query .text,.thought .text{display:flex;justify-content:space-between;align-items:center;}.toast{position:fixed;left:50%;top:28px;transform:translateX(-50%);background:#ffd54f;color:#000;padding:12px 32px;border-radius:8px;opacity:0;box-shadow:0 4px 24px #0007;transition:opacity 0.3s,transform 0.3s;z-index:2002;font-size:16px;font-weight:bold;pointer-events:none;}.toast.show{opacity:1;transform:translateX(-50%) scale(1.04);}.source-flex{display:flex;justify-content:space-between;align-items:flex-start;}.source-info{flex:1;min-width:0;}.source-copy{margin-left:16px;}.sources-header{display:flex;align-items:center;gap:12px;margin-top:22px;margin-bottom:8px;}#sidebar{position:fixed;top:0;right:0;width:250px;height:100vh;background:#232323;border-left:2px solid #222;display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:1001;box-shadow:-2px 0 12px 0 #0006;}#sidebar img{max-width:120px;margin-bottom:20px;}#sidebar .credit{font-size:14px;color:#ccc;text-align:center;line-height:1.5;padding:0 14px;}@media (max-width:1000px){#sidebar{display:none;}#main-content{max-width:97vw;}}%60;doc.head.appendChild(style);const toast=doc.createElement("div");toast.className="toast";toast.id="toast";toast.textContent="Copied!";doc.body.appendChild(toast);const main=doc.createElement("div");main.id="main-content";doc.body.appendChild(main);const header=doc.createElement("div");header.className="header";const title=doc.createElement("h1");title.textContent="ChatGPT Reasoning and Search Query Extractor";const copyAllBtn=doc.createElement("button");copyAllBtn.textContent="Copy All Queries";copyAllBtn.onclick=()=>copyText(queries.map(q=>q.q).join("\n"),doc);header.appendChild(title);header.appendChild(copyAllBtn);main.appendChild(header);queries.forEach(q=>{const wrap=doc.createElement("div");wrap.className="query";const textLine=doc.createElement("div");textLine.className="text";const span=doc.createElement("span");span.textContent=q.q;const btn=doc.createElement("button");btn.textContent="Copy";btn.onclick=()=>copyText(q.q,doc);textLine.appendChild(span);textLine.appendChild(btn);wrap.appendChild(textLine);main.appendChild(wrap)});if(thoughtsList.length>0){const h2=doc.createElement("h2");h2.textContent="AI Reasoning / Thoughts";main.appendChild(h2);thoughtsList.forEach(thought=>{const wrap=doc.createElement("div");wrap.className="thought";const textLine=doc.createElement("div");textLine.className="text";const span=doc.createElement("span");span.textContent=thought;const btn=doc.createElement("button");btn.textContent="Copy";btn.onclick=()=>copyText(thought,doc);textLine.appendChild(span);textLine.appendChild(btn);wrap.appendChild(textLine);main.appendChild(wrap)})}if(sourcesList.length>0){const sourcesHeader=doc.createElement("div");sourcesHeader.className="sources-header";const h2=doc.createElement("h2");h2.textContent="Sources Accessed";sourcesHeader.appendChild(h2);const copyAllUrlsBtn=doc.createElement("button");copyAllUrlsBtn.textContent="Copy All URLs";copyAllUrlsBtn.onclick=()=>copyText(sourcesList.map(s=>s.url).join("\n"),doc);sourcesHeader.appendChild(copyAllUrlsBtn);main.appendChild(sourcesHeader);sourcesList.forEach(source=>{const wrap=doc.createElement("div");wrap.className="query";wrap.style.background="#222";const flex=doc.createElement("div");flex.className="source-flex";const info=doc.createElement("div");info.className="source-info";const title=doc.createElement("div");title.style.fontWeight="bold";title.style.marginBottom="3px";title.textContent=source.title;const url=doc.createElement("a");url.href=source.url;url.textContent=source.url;url.style.display="block";url.style.color="#ffd54f";url.style.marginBottom="3px";url.style.wordBreak="break-all";url.target="_blank";const snippet=doc.createElement("div");snippet.textContent=source.snippet;snippet.style.fontSize="14px";snippet.style.color="#ccc";snippet.style.marginBottom="5px";info.appendChild(title);info.appendChild(url);info.appendChild(snippet);const copyBtn=doc.createElement("button");copyBtn.textContent="Copy URL";copyBtn.className="source-copy";copyBtn.onclick=()=>copyText(source.url,doc);flex.appendChild(info);flex.appendChild(copyBtn);wrap.appendChild(flex);main.appendChild(wrap);});}const sidebar=doc.createElement("div");sidebar.id="sidebar";const logo=doc.createElement("img");logo.src="https://theseopub.com/wp-content/uploads/2025/01/seopub-white-logo-transparent-400x335-1.png";logo.alt="The SEO Pub Logo";sidebar.appendChild(logo);const credit=doc.createElement("div");credit.className="credit";credit.innerHTML='Script by <strong>Mike Friedman</strong>.<br>For more great AI SEO tools and tips visit <a href="https://theseopub.com/" target="_blank" style="color:#ffd54f;">The SEO Pub</a>.';sidebar.appendChild(credit);doc.body.appendChild(sidebar);function copyText(text,targetDoc){const ta=targetDoc.createElement("textarea");ta.value=text;targetDoc.body.appendChild(ta);ta.select();try{targetDoc.execCommand("copy");showToast()}catch(e){alert("Clipboard copy failed.")}targetDoc.body.removeChild(ta)}function showToast(){const t=doc.getElementById("toast");t.classList.add("show");setTimeout(()=>t.classList.remove("show"),2000)}}catch(e){alert("Failed to fetch data—are you logged in to ChatGPT?");console.error(e)}})();
⚙️ Here’s How You’d Do This Manually (The Hard Way)
- Open DevTools (
Cmd+Opt+I
on Mac orCtrl+Shift+I
on Windows) - Go to the Network tab and clear the logs
- Trigger a response in ChatGPT that uses web browsing
- Filter for
conversation/
in the network log - Click the most recent call to
/backend-api/conversation/{id}
- Open the Response tab
- Manually search through the JSON to find:
search_queries[].q
→ the queries sent to Bingcontent_type: "thoughts"
blocks → ChatGPT’s internal reasoning
- Copy/paste the results somewhere useful
- Format it into something human-readable
😵💫 And that’s just for one conversation.
⚡ This Bookmarklet Automates All of That
1 click → formatted output
No DevTools, no JSON digging, no frustration