免费垃圾分类API接口,可以查询上千种垃圾名称,可以模糊查询垃圾类型,永久免费垃圾分类API接口。

在线查询垃圾分类 地址:https://www.soword.cn/onlinetools/1170.html


请求费用:免费不限

接口地址:http(s)://api.soword.cn/garbage

返回格式:json

请求方式:http(s) get/post

请求示例:http(s)://api.soword.cn/garbage?key=MTU5NHDc5M45z5g2MjM4&name=电灯

返回参数:

{"status":"0","name":"电灯","message":"可回收垃圾"}

备注:name为空默认:电灯


传输参数:

key:后台免费申请

name:垃圾名称


其他返回参数:

status:0  正确  1  key值错误或其他错误
message: name:垃圾名称 message:垃圾类型


我们这里只演示jQuery请求:

(其他PHP、Java、Python等均可)

$.ajax({

                type: 'GET',
                url: 'https://api.soword.cn/garbage?key=MTU5NHDc5M45z5g2MjM4&name=电灯',
                dataType: 'json',
                success: function(data){
               console.log(data);
                },
                error: function (e) {
                alert("error");
                }

 

               });