接口地址: http://vip.http110.cn/api/sogoLink2Wxlink
返回格式: json
请求方式: http(s) get/post
请求示例: http://vip.http110.cn/api/sogoLink2Wxlink?token=&url=www.baidu.com
请求参数说明:
参数名称 | 必填 | 类型 | 说明 |
---|---|---|---|
token | 否 | string | 用户token,注册即可获得试用token |
url | 是 | string | 搜狗微信文章链接(mp.weixin.qq.com/s?src=11开头, get请求时,用urlEncode编码) |
返回参数说明:
参数名称 | 类型 | 说明 |
---|---|---|
code | number | 系统返回状态码 |
msg | string | 系统返回提示信息! |
data | string | 微信文章链接 |
oriLink | string | 搜狗临时链接 |
permanentLink | string | 文章永久链接 |
shortLink | string | 永久链接对应的短链接 |
响应文本:
{
"code": 200,
"msg": "OK",
"data": {
"oriLink": "https://mp.weixin.qq.com/s?src=11×tamp=1680002812&ver=4434&signature=GSiBxNqLBTb5gOWjQio*aatCxhlfJJ7neUcEDpMFCrQ5FRDam0YF8THwm0joQKJI0tbloRQBY*vKIJP63*B20JcCrTwKdJffEHpamAqEuXrDDhACFnmL4Cpa9ZMlSdYi&new=1",
"permanentLink": "https://mp.weixin.qq.com/s?__biz=MzI2NDk5NzA0Mw==&mid=2247511179&idx=1&sn=872023f44bfd0b1d25222f6793a09a45#rd",
"shortLink": "https://mp.weixin.qq.com/s/MkHAd-zYBfHuM0hKvo5g5Q"
}
}
状态码参考:
状态码 | 说明 | |
---|---|---|
200 | 请求成功 | |
201 | 余额不足! |
免费!
var settings = { "url": "http://vip.http110.cn/api/sogoLink2Wxlink", "method": "POST", "timeout": 0, "headers": { "Content-Type": "application/json" }, "data": JSON.stringify({ "token": "your token", "url": "https://mp.weixin.qq.com/s?src=11×tamp=1680002812&ver=4434&signature=GSiBxNqLBTb5gOWjQio*aatCxhlfJJ7neUcEDpMFCrQ5FRDam0YF8THwm0joQKJI0tbloRQBY*vKIJP63*B20JcCrTwKdJffEHpamAqEuXrDDhACFnmL4Cpa9ZMlSdYi&new=1" }), }; $.ajax(settings).done(function (response) { console.log(response); });
CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST"); curl_easy_setopt(curl, CURLOPT_URL, "http://vip.http110.cn/api/sogoLink2Wxlink"); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "Content-Type: application/json"); curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); const char *data = "{\n \"token\":\"your token\",\"url\":\"https://mp.weixin.qq.com/s?src=11×tamp=1680002812&ver=4434&signature=GSiBxNqLBTb5gOWjQio*aatCxhlfJJ7neUcEDpMFCrQ5FRDam0YF8THwm0joQKJI0tbloRQBY*vKIJP63*B20JcCrTwKdJffEHpamAqEuXrDDhACFnmL4Cpa9ZMlSdYi&new=1\"\n}"; curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data); res = curl_easy_perform(curl); } curl_easy_cleanup(curl);
require_once 'HTTP/Request2.php'; $request = new HTTP_Request2(); $request->setUrl('http://vip.http110.cn/api/sogoLink2Wxlink'); $request->setMethod(HTTP_Request2::METHOD_POST); $request->setConfig(array( 'follow_redirects' => TRUE )); $request->setHeader(array( 'Content-Type' => 'application/json' )); $request->setBody('{\n "token":"your token","url":"https://mp.weixin.qq.com/s?src=11×tamp=1680002812&ver=4434&signature=GSiBxNqLBTb5gOWjQio*aatCxhlfJJ7neUcEDpMFCrQ5FRDam0YF8THwm0joQKJI0tbloRQBY*vKIJP63*B20JcCrTwKdJffEHpamAqEuXrDDhACFnmL4Cpa9ZMlSdYi&new=1"\n}'); try { $response = $request->send(); if ($response->getStatus() == 200) { echo $response->getBody(); } else { echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' . $response->getReasonPhrase(); } } catch(HTTP_Request2_Exception $e) { echo 'Error: ' . $e->getMessage(); }
OkHttpClient client = new OkHttpClient().newBuilder() .build(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\n \"token\":\"your token\",\"url\":\"https://mp.weixin.qq.com/s?src=11×tamp=1680002812&ver=4434&signature=GSiBxNqLBTb5gOWjQio*aatCxhlfJJ7neUcEDpMFCrQ5FRDam0YF8THwm0joQKJI0tbloRQBY*vKIJP63*B20JcCrTwKdJffEHpamAqEuXrDDhACFnmL4Cpa9ZMlSdYi&new=1\"\n}"); Request request = new Request.Builder() .url("http://vip.http110.cn/api/sogoLink2Wxlink") .method("POST", body) .addHeader("Content-Type", "application/json") .build(); Response response = client.newCall(request).execute();
import requests import json url = "http://vip.http110.cn/api/sogoLink2Wxlink" payload = json.dumps({ "token": "your token", "url": "https://mp.weixin.qq.com/s?src=11×tamp=1680002812&ver=4434&signature=GSiBxNqLBTb5gOWjQio*aatCxhlfJJ7neUcEDpMFCrQ5FRDam0YF8THwm0joQKJI0tbloRQBY*vKIJP63*B20JcCrTwKdJffEHpamAqEuXrDDhACFnmL4Cpa9ZMlSdYi&new=1" }) headers = { 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text)
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "http://vip.http110.cn/api/sogoLink2Wxlink" method := "POST" payload := strings.NewReader(`{ "token":"your token","url":"https://mp.weixin.qq.com/s?src=11×tamp=1680002812&ver=4434&signature=GSiBxNqLBTb5gOWjQio*aatCxhlfJJ7neUcEDpMFCrQ5FRDam0YF8THwm0joQKJI0tbloRQBY*vKIJP63*B20JcCrTwKdJffEHpamAqEuXrDDhACFnmL4Cpa9ZMlSdYi&new=1" }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) }
curl --location --request POST 'http://vip.http110.cn/api/sogoLink2Wxlink' \ --header 'Content-Type: application/json' \ --data-raw '{ "token":"your token","url":"https://mp.weixin.qq.com/s?src=11×tamp=1680002812&ver=4434&signature=GSiBxNqLBTb5gOWjQio*aatCxhlfJJ7neUcEDpMFCrQ5FRDam0YF8THwm0joQKJI0tbloRQBY*vKIJP63*B20JcCrTwKdJffEHpamAqEuXrDDhACFnmL4Cpa9ZMlSdYi&new=1" }'