开发者文档,微信域名黑名单检测API
接口地址:http://tools.bugscaner.com/api/weixin
返回格式:json
请求方式:get
请求示例:
http://tools.bugscaner.com/api/weixin?uid=bugscaner&key=您申请的APPKEY&url=http://www.baidu.com/
接口备注:请求频率限制请在会员中心查看
请求参数说明:
uid | 必须的字段 |
key | APP Key(必填字段) |
url | 需要检测的完整url |
返回参数说明:
{ "status": true, /*提交状态false为通讯失败,true是通讯成功*/ "main_type": 0, /*拦截类型0为未拦截*/ "evil_type": 0, /*拦截详细状态0为域名未被拦截*/ "mark": "拦截类型信息提示" /*域名查询备注*/ "url": "baidu.com" /*所查询的url地址 返回顶级域名*/ }详细拦截状态码,请点击右侧按钮查看Click Me
代码示例:
PHP调用检测微信域名拦截接口示例:
<?php $url = 'http://www.baidu.com/'; $uid = 'test'; $key = 'h89jkjjk8769jjko998990088'; $url = 'http://tools.bugscaner.com/api/weixin?uid='.$uid.'&key='.$key.'&url='.$url; $header = array(); echo getData($url,$header); function getData($url,$header){ $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_1); curl_setopt($ch,CURLOPT_HTTPHEADER,$header); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,3); $handles = curl_exec($ch); curl_close($ch); return $handles; } ?>
Python2和Python3调用检测微信域名拦截接口示例:
#! /usr/bin/env python #coding=utf-8 #python2和python3 微信域名拦截检测脚本API 代码示例 #注意 注意 运行本脚本,请确认已安装requests 若没有安装 #请在DOS窗口执行 pip install requests import requests url = "http://www.baidu.com/" uid = "test" key = "h89jkjjk8769jjko998990088" apiurl = "http://tools.bugscaner.com/api/weixin?uid="+uid+"&key="+key+"&url="+url html = requests.get(apiurl) print html
Java调用检测微信域名拦截接口示例:
public class QueryHelper { public static String uid="test"; public static String key="h89jkjjk8769jjko998990088"; public static String get(String urlString) { try { URL url = new URL(urlString); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setConnectTimeout(5 * 1000); conn.setReadTimeout(5 * 1000); conn.setDoInput(true); conn.setDoOutput(true); conn.setUseCaches(false); conn.setInstanceFollowRedirects(false); conn.setRequestMethod("GET"); int responseCode = conn.getResponseCode(); if (responseCode == 200) { StringBuilder builder = new StringBuilder(); BufferedReader br = new BufferedReader( new InputStreamReader(conn.getInputStream(),"utf-8")); for (String s = br.readLine(); s != null; s = br .readLine()) { builder.append(s); } br.close(); return builder.toString(); } } catch (IOException e) { e.printStackTrace(); } return null; } public static String queryURL(String url){ String geturl="http://tools.bugscaner.com/api/weixin?uid="+uid+"&key="+key+"&url="+url; return get(geturl); } } //以下是使用示例: //QueryHelper.queryURL("http://www.baidu.com/");
C#(.net)web调用检测微信域名拦截接口示例:
using System; using System.Collections.Generic; using System.Web; using System.Net; using System.Text; public class WXtest { public static string GetUrlData(string uid, string key,string wxurl) { string url = string.Format("http://tools.bugscaner.com/api/weixin?uid={0}&key={1}&url={2}", uid, key, wxurl); using (WebClient client = new WebClient()) { client.Encoding = Encoding.UTF8; return client.DownloadString(url); } } } string data = WXtest.GetUrlData("test","h89jkjjk8769jjko998990088","http://www.baidu.com/"); Console.WriteLine(data); Response.Write(data);
asp调用检测微信域名拦截接口示例:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <% Option Explicit '========================================================= ' File : .asp ' Version : 1.0.0.0 ' Create : ' Modify : '========================================================= ' 1.0.0.0 : '========================================================= %> <% Dim uid,key,wxurl uid = "test" key = "h89jkjjk8769jjko998990088" wxurl = "http://www.baidu.com/" url = "http://tools.bugscaner.com/api/weixin?uid="&uid&"&key="&key&"&url="&wxurl Response.Write (GetURL(url)) Function GetURL(url) on error resume next dim Retrieval Set Retrieval = Server.CreateObject("MSXML2.ServerXMLHTTP") Retrieval.setTimeouts 600000, 600000, 600000, 600000 Retrieval.Open "GET", url, false Retrieval.Send GetURL = Retrieval.ResponseBody Set Retrieval = Nothing GetURL=BytesToBstr(GetURL,"utf-8") End Function Function BytesToBstr(strBody,CodeBase) dim objStream set objStream = Server.CreateObject("Adodb.Stream") objStream.Type = 1 objStream.Mode =3 objStream.Open objStream.Write strBody objStream.Position = 0 objStream.Type = 2 objStream.Charset = CodeBase BytesToBstr = objStream.ReadText objStream.Close set objStream = nothing End Function %>