---
title: API接口CORS检测工具
description: 网上冲浪的时候经常在寻找可用的免费API，借助这个API可用进行一些开发练习。但是判断API是否可以跨域使用，需要手动查看比较费神，于是结合AI编写了对应的检测
author: chaihongjun
category: frontend
published: 2025-09-11
url: https://chaihongjun.me/frontend/54.html
---

# API接口CORS检测工具

网上冲浪的时候经常在寻找可用的免费API，借助这个API可用进行一些开发练习。但是判断API是否可以跨域使用，需要手动查看比较费神，于是结合AI编写了对应的检测脚本和检测页面。

方法一：

如果电脑有安装node环境，并且已经安装了axios，则建议直接使用检测脚本进行检测：

![CORS检测工具](https://chaihongjun.me/public/uploads/images/20250911/1757582830724995.jpg)

使用方法是：

MDBLOCK0
默认情况如果是get请求，则不需要传递--method及其后面的参数。

>  !https://chaihongjun.me/public/static/js/ueditor/dialogs/attachment/fileTypeImages/icon_txt.gifcheck-cors.js.txthttps://chaihongjun.me/public/uploads/files/20250911/check-cors.js.txt

以上是脚本文件，下载之后文件后缀修改为js之后再使用。

方法二：

如果电脑既没有node环境也没有安装axios，也不想安装，则可以直接使用浏览器，浏览检测页面：

> !https://chaihongjun.me/public/static/js/ueditor/dialogs/attachment/fileTypeImages/icon_txt.gifcheck-cors.html.txthttps://chaihongjun.me/public/uploads/files/20250911/check-cors.html.txt

将以上文件下载，以html后缀进行浏览操作即可。

---

> 本文首发于 [chaihongjun.me | 柴宏俊 web 技术学习笔记](https://chaihongjun.me/frontend/54.html)，采用 CC BY-NC-ND 4.0 协议，转载请保留出处与链接。
