Bright Data ChatGPT 搜索爬取器(Node.js)

在 CodeSandbox 打开,使用 GitHub 登录,然后 fork 该仓库开始修改。

本项目提供一个简单的 Node.js 模板,使用 Bright Data Web Scraper API 爬取 ChatGPT AI 搜索 的结果。


目录


概述

该仓库演示如何使用 Bright Data Scraper API 触发并下载 ChatGPT AI 搜索结果。包含示例提示词以及用于批量与自定义搜索的工具函数。


功能

  • 通过 Bright Data Scraper 的 /trigger API 端点触发 ChatGPT AI 搜索
  • 使用 /status 端点监控进度
  • 将结果下载并保存为 JSON

先决条件

  • Node.js v16 或更高版本
  • 拥有带 API KEY 的 Bright Data 账号

安装

sh 复制代码
git clone https://github.com/your-org/bright-data-scrape-chatgpt-search-nodejs-project.git
cd bright-data-scrape-chatgpt-search-nodejs-project
npm install

用法

  1. 设置你的 Bright Data API Token

    编辑 index.js 并设置你的 API Token:

    js 复制代码
    const API_TOKEN = 'YOUR_API_TOKEN_HERE';
  2. 运行爬取脚本

    sh 复制代码
    node index.js

    结果会以带时间戳的 .json 文件保存在项目目录中。


配置

  • API Token:

    在 Bright Data 控制台的账户设置中获取你的 API Token。

  • 数据集 ID(Dataset ID):

    ChatGPT AI Search 的默认数据集 ID 已在 index.js 中设置好。


示例

运行示例搜索

脚本默认会执行三个示例提示词:

js 复制代码
const SAMPLE_SEARCHES = [
  { url: "https://chatgpt.com/", prompt: "Top hotels in New York", country: "" ],
  { url: "https://chatgpt.com/", prompt: "What are the biggest business trends to watch in the next five years?", country: "" ],
  { url: "https://chatgpt.com/", prompt: "Best practices for remote team management", country: "" }
];

自定义搜索

在 index.js 中取消注释并修改以下内容以运行你自己的提示词:

js 复制代码
const customSearch = [createSearch("Best programming languages to learn in 2024")];
const customResults = await searchChatGPT(customSearch);
await saveResults(customResults, 'custom_search.json');

批量搜索

js 复制代码
const multipleSearches = [
  createSearch("Climate change solutions"),
  createSearch("AI ethics guidelines"),
  createSearch("Sustainable business practices")
];
const multiResults = await searchChatGPT(multipleSearches);
await saveResults(multiResults, 'multiple_searches.json');

输出

  • 结果将保存为 JSON 文件(例如 chatgpt_results_YYYY-MM-DDTHH-MM-SS.json)。
  • 每个文件包含来自 Bright Data 的原始 API 响应。

支持


许可证

本项目基于 MIT 许可证发布。详情见 。

相关推荐
ZhengEnCi21 小时前
韩国高考 AI 作弊:防作弊为什么总比作弊慢一步
人工智能·chatgpt
枫叶丹43 天前
AI文本水印:生成机制、统计检测与误报
人工智能·机器学习·chatgpt·agent·codex
2601_967979126 天前
OpenAI创始成员发布开源项目nanochat,仅需100美元就能实现类ChatGPT
chatgpt·openai·llm训练·nanochat·安德烈·卡帕西
ndz7 天前
一把 Key 接多家模型,再查 AI 会不会推荐你的品牌
chatgpt
ndz8 天前
怎么查 ChatGPT / Perplexity 会不会推荐你的品牌
chatgpt
星恒随风8 天前
从0实现C++ AI大模型接入SDK(二):AI知识科普——从图灵测试到ChatGPT,人工智能的发展历程
linux·c++·人工智能·笔记·chatgpt
bryant_meng11 天前
ChatGPT Desktop Model Evolution (2025): From GPT-4.1 to GPT-5.1
gpt·chatgpt·gpt4·gpt4o·gpt5
一缕82年的清风12 天前
OpenAI 突发 GPT-6.2:Sol 提速 8 倍跑分追平旗舰,但这 1 处暗改会让缓存直接失效!
gpt·chatgpt
死磕音视频13 天前
Businesses in ChatGPT 入门:在 Business Hub 认领商家并完成验证
chatgpt·入门教程·business hub·商家资料
泯泷13 天前
OpenClaw 退潮背后,是 AI 圈“技术自嗨”的终结
人工智能·chatgpt·llm