菜谱大全
京东万象 官方文档
万种菜谱,包含主料、辅料,制作流程。分分钟让你成为厨神
基本说明:
接口地址:https://way.jd.com/jisuapi/search
返回格式:json
请求方式:get/post
请求示例:https://way.jd.com/jisuapi/search?keyword=白菜&num=10&appkey=您申请的APPKEY
请求参数说明:
名称 类型 必填 说明
appkey sting 必填 该平台的appkey 扫码关注公众号
keyword string 必填 关键词
num int 必填 获取数量,最大值为20
返回参数说明:
名称 类型 说明
- - 见json
JSON返回示例:
{
	"code": "10000",
	"charge": false,
	"msg": "查询成功",
	"result": {
		"status": "0",
		"msg": "ok",
		"result": {
			"num": "10",
			"list": [{
				"id": "8",
				"classid": "2",
				"name": "醋溜白菜",
				"peoplenum": "1-2人",
				"preparetime": "10-20分钟",
				"cookingtime": "10-20分钟",
				"content": "醋溜白菜,是北方人经常吃的一道菜,尤其是在多年前的冬天。那时,没有大棚菜,冬天,家家每天佐餐的基本上都是冬储大白菜,聪明的家庭主妇总是想方设法将这单调的菜变成多种菜式,于是,醋溜白菜被频繁的端上餐桌。  美食不分贵贱,用最平凡的原料、最简单的调料和最普通的手法做出美味的菜肴来才是美食的真谛。   这次,我做的醋溜白菜,近似鲁菜的做法,使个这道菜酸甜浓郁、开胃下饭、老少咸宜。",
				"pic": "http://api.jisuapi.com/recipe/upload/20160719/115138_46688.jpg",
				"tag": "减肥,家常菜,排毒,补钙",
				"material": [{
					"mname": "油",
					"type": "0",
					"amount": "适量"
				}, {
					"mname": "盐",
					"type": "0",
					"amount": "适量"
				}, {
					"mname": "花椒",
					"type": "0",
					"amount": "适量"
				}, {
					"mname": "干红椒",
					"type": "0",
					"amount": "适量"
				}, {
					"mname": "葱",
					"type": "0",
					"amount": "适量"
				}, {
					"mname": "姜",
					"type": "0",
					"amount": "适量"
				}, {
					"mname": "蒜",
					"type": "0",
					"amount": "适量"
				}, {
					"mname": "醋",
					"type": "0",
					"amount": "适量"
				}, {
					"mname": "酱油",
					"type": "0",
					"amount": "适量"
				}, {
					"mname": "糖",
					"type": "0",
					"amount": "适量"
				}, {
					"mname": "淀粉",
					"type": "0",
					"amount": "适量"
				}, {
					"mname": "白菜",
					"type": "1",
					"amount": "380g"
				}],
				"process": [{
					"pcontent": "准备食材。",
					"pic": "http://api.jisuapi.com/recipe/upload/20160719/162550_84583.jpg"
				}, {
					"pcontent": "将白菜斜刀片成薄片。",
					"pic": "http://api.jisuapi.com/recipe/upload/20160719/162551_90620.jpg"
				}, {
					"pcontent": "片切好的白菜帮与菜叶分别入好。",
					"pic": "http://api.jisuapi.com/recipe/upload/20160719/162551_20925.jpg"
				}, {
					"pcontent": "盐、糖、生抽、醋淀粉加少许水调匀备用。",
					"pic": "http://api.jisuapi.com/recipe/upload/20160719/162552_23125.jpg"
				}, {
					"pcontent": "锅中油烧热,先入花椒炒香后捞出。再加入干红椒段略炒。",
					"pic": "http://api.jisuapi.com/recipe/upload/20160719/162552_57046.jpg"
				}, {
					"pcontent": "加入葱姜蒜煸炒香,然后入白菜帮翻炒。",
					"pic": "http://api.jisuapi.com/recipe/upload/20160719/162553_89090.jpg"
				}, {
					"pcontent": "炒至菜帮变软时,加入白菜叶。",
					"pic": "http://api.jisuapi.com/recipe/upload/20160719/162553_40445.jpg"
				}, {
					"pcontent": "快速翻炒至菜软,勾入碗汁",
					"pic": "http://api.jisuapi.com/recipe/upload/20160719/162554_92210.jpg"
				}, {
					"pcontent": "使汤汁均匀的包裹在菜帮上即可",
					"pic": "http://api.jisuapi.com/recipe/upload/20160719/162554_29522.jpg"
				}]
			}]
		}
	}
}
服务级错误码参照
错误码 说明
10001 错误的请求appkey
11010 商家接口调用异常,请稍后再试
11030 商家接口返回格式有误
10003 不存在相应的数据信息
10004 URL上appkey参数不能为空
10010 接口需要付费,请充值
10020 万象系统繁忙,请稍后再试
10030 调用万象网关失败, 请与万象联系
10040 超过每天限量,请明天继续
10050 用户已被禁用
10060 提供方设置调用权限,请联系提供方
10070 该数据只允许企业用户调用
10090 文件大小超限,请上传小于1M的文件
完整教学代码示例
<?php
/**
 * Created by PhpStorm.
 * User: FZS
 * Time: 2020/12/01 22:26
 */
class freeApi
{
    private $apiUrl;

    public function __construct()
    {
        $this->apiUrl = 'https://way.jd.com/jisuapi/search?keyword=白菜&num=10&appkey=您申请的APPKEY';
    }

    /**
     * 获取结果
     * @return array
     */
    public function getResult()
    {
        return file_get_contents($this->apiUrl);
    }
}
package main

import (
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
)

const (
	APIURL   = "https://way.jd.com/jisuapi/search?keyword=白菜&num=10&appkey=您申请的APPKEY"
)

func main() {
	queryUrl := fmt.Sprintf("%s",APIURL)
	resp, err := http.Get(queryUrl)
	if err != nil {
		log.Println(err)
		return
	}

	defer resp.Body.Close()

	body, err := ioutil.ReadAll(resp.Body)

	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}