## 驾照题库 >[danger]### 免费接口,每日100次免费调用,会员可不限次数调用,购买[API会员](https://market.topthink.com/product/210) ![](https://img.kancloud.cn/41/4c/414cdacd85519853fdbfc0a7e15bcf42_168x138.png) > 采用公安部2019最新驾校模拟考试题库 ## 接口调用([调用须知](https://docs.topthink.com/think-api/1835086)) ### 请求地址 ``` GET https://api.topthink.com/driving/query ``` ### 请求参数 | 名称 | 必填 | 类型 | 说明 | | --- | --- | --- | --- | | appCode| 是| string|用户授权码,参考[API调用](https://docs.topthink.com/think-api/1835086) | | subject | 是 | int | 选择考试科目类型,1:科目1;4:科目4 | | model | 是 | string | 驾照类型,可选择参数为:c1,c2,a1,a2,b1,b2;当subject=4时可省略 | | testType | 否 | string | 测试类型,rand:随机测试(随机100个题目),order:顺序测试(所选科目全部题目) | ### 返回`data`参数 | 名称 | 类型 | 说明 | | --- | --- | --- | | question| string | 问题| | answer| string | 答案 | | item1| string | 选项1,当内容为空时表示判断题正确选项 | | item2| string | 选项2,当内容为空时表示判断题错误选项 | | item3| string | 选项3 | | item4| string | 选项4 | | explains|string|答案解释| | url|string|图片URL地址| 当四个选项都为空的时候表示判断题,item1:正确 item2:错误,请开发者自行判断! answer答案字段对应解析: ``` "1": "A或者正确", "2": "B或者错误", "3": "C", "4": "D", "7": "AB", "8": "AC", "9": "AD", "10": "BC", "11": "BD", "12": "CD", "13": "ABC", "14": "ABD", "15": "ACD", "16": "BCD", "17": "ABCD" ``` ## SDK调用 ``` $client = new Client("YourAppCode"); $result = $client->drivingQuery() ->withSubject(1) ->withModel('c1') ->withTestType('rand') ->request(); dump($result); ``` 返回数据示例: ~~~ { "code": 0, "message": "成功", "data": { { "id": 12, "question": "这个标志是何含义?",//问题 "answer": "4",//答案 "item1": "前方40米减速",//选项,当内容为空时表示判断题正确选项 "item2": "最低时速40公里",//选项,当内容为空时表示判断题错误选项 "item3": "限制40吨轴重", "item4": "限制最高时速40公里", "explains": "限制最高时速40公里:表示该标志至前方限制速度标志的路段内,机动车行驶速度不得超过标志所示数值。此标志设在需要限制车辆速度的路段的起点。以图为例:限制行驶时速不得超过40公里。",//答案解释 "url": "http://images.juheapi.com/jztk/c1c2subject1/12.jpg"//图片url } ... }, } ~~~