用户协议
错别字、通顺度智能纠错API
检测内容中有错误或可改善的地方,给出错误提示的位置及对应的替换内容。
  • 接口状态:正常
  • 接入服务商: 5118.com
  • 应用类别: 智能改写
  • 上线时间:2021-02-04
  • API说明
  • 错误码参照
  • 价格与请求限制
  • 示例代码
详细说明:
  • 接口地址:http://apis.5118.com/wyc/smoothv2
  • 返回格式:json
  • 请求方式:POST
  • 在线调试

请求示例:http://apis.5118.com/wyc/smoothv2
提交任务调试工具: Postman示例
提交任务请求参数说明:
名称 类型 必填 默认值 说明
txt string 需要检查通顺度的文本(文本最长不能超过1000字)
提交任务返回参数说明:
名称 类型 默认值 说明
errcode string 0 返回的错误代码
errmsg string 返回的错误说明
index int 当前段落中不通顺的字出现的字符位置,汉字和英文都算1个位置
end int 当前段落中不通顺的字最后字符的位置,汉字和英文都算1个位置
text string 智能算法检测到可能不通顺的字,也可能是错别字
old_str string 错误文本
repl_str string 替换文本
op int 操作类型(1:在old_str前新增,2:在old_str后新增,3:删除,4:替换,16:没有操作)
sug string 建议或提示信息
JSON返回示例:
{
    "errcode": "0",
    "errmsg": "",
    "data": {
        "Result": [
            [
                {
                    "index": 66,
                    "end": 66,
                    "text": "的",
                    "old_str": "的",
                    "repl_str": "得",
                    "op": 4,
                    "sug": "建议用 \"得\" 替换 \"的\" "
                }
            ],
            []
        ]
    }
}

提交充值订单
状态回调配置说明
服务级错误码参照(error_code):
错误码 说明
100101 调用次数不够,请充值
100102 服务每秒调用量超限
100103 服务每小时调用量超限
100104 服务每天调用量超限
100111 调用字数不够,请充值
100201 url无法解析
100202 请求缺少apikey
100203 无效的apikey
100204 api不存在
100205 api已经关闭
100206 后端服务响应status非200
100207 后端服务未正确接入
100208 请求方式不支持
100301 Api商城 内部错误
100302 请求后端服务过程中错误
100303 系统繁忙稍候再试
100403 您输入的apikey不正确
系统级错误码参照:
错误码 说明
200201 传进参数为空
200202 用户ID为空
200500 内容长度超过指定长度
200504 出现异常情况
错误码格式说明:
2 002 01
服务器错误(1:为系统级别错误) 服务模块代码(即数据ID) 具体错误代码
资费说明:
名称 价格 次数 说明
试用套餐 0.00 100
套餐一 1600.00 10000
套餐二 12000.00 100000
套餐三 100000.00 1000000
示例代码:
  1. <?php
  2. $curl = curl_init();
  3. curl_setopt_array($curl, array(
  4. CURLOPT_URL => "https://apis.5118.com/wyc/smoothv2",
  5. CURLOPT_RETURNTRANSFER => true,
  6. CURLOPT_ENCODING => "",
  7. CURLOPT_MAXREDIRS => 10,
  8. CURLOPT_TIMEOUT => 30,
  9. CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  10. CURLOPT_CUSTOMREQUEST => "POST",
  11. CURLOPT_POSTFIELDS => "txt=",
  12. CURLOPT_HTTPHEADER => array(
  13. "authorization: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  14. "content-type: application/x-www-form-urlencoded"
  15. ),
  16. ));
  17. $response = curl_exec($curl);
  18. $err = curl_error($curl);
  19. curl_close($curl);
  20. if ($err) {
  21. echo "cURL Error #:" . $err;
  22. } else {
  23. echo $response;
  24. }
  1. using System.IO;
  2. using System.Text;
  3. using System.Net;
  4. using System.Net.Security;
  5. using System.Security.Cryptography.X509Certificates;
  6. private const String host = "https://apis.5118.com";
  7. private const String path = "/wyc/smoothv2";
  8. private const String method = "POST";
  9. private const String apikey = "你要调用的接口apikey";
  10. static void Main(string[] args)
  11. {
  12. String querys = "";
  13. String bodys = "txt=txt";
  14. String url = host + path;
  15. HttpWebRequest httpRequest = null;
  16. HttpWebResponse httpResponse = null;
  17. if (0 < querys.Length)
  18. {
  19. url = url + "?" + querys;
  20. }
  21. if (host.Contains("https://"))
  22. {
  23. ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
  24. httpRequest = (HttpWebRequest)WebRequest.CreateDefault(new Uri(url));
  25. }
  26. else
  27. {
  28. httpRequest = (HttpWebRequest)WebRequest.Create(url);
  29. }
  30. httpRequest.Method = method;
  31. httpRequest.Headers.Add("Authorization", apikey);
  32. //根据API的要求,定义相对应的Content-Type
  33. httpRequest.ContentType = "application/x-www-form-urlencoded; charset=UTF-8";
  34. if (0 < bodys.Length)
  35. {
  36. byte[] data = Encoding.UTF8.GetBytes(bodys);
  37. using (Stream stream = httpRequest.GetRequestStream())
  38. {
  39. stream.Write(data, 0, data.Length);
  40. }
  41. }
  42. try
  43. {
  44. httpResponse = (HttpWebResponse)httpRequest.GetResponse();
  45. }
  46. catch (WebException ex)
  47. {
  48. httpResponse = (HttpWebResponse)ex.Response;
  49. }
  50. Console.WriteLine(httpResponse.StatusCode);
  51. Console.WriteLine(httpResponse.Method);
  52. Console.WriteLine(httpResponse.Headers);
  53. Stream st = httpResponse.GetResponseStream();
  54. StreamReader reader = new StreamReader(st, Encoding.GetEncoding("utf-8"));
  55. Console.WriteLine(reader.ReadToEnd());
  56. Console.WriteLine("\n");
  57. }
  58. public static bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
  59. {
  60. return true;
  61. }
推荐API
百亿长尾词库,含指数和搜索量
获取域名(含子域名)PC端排名词

系统通知