API文档
API文档

图库接口文档说明

接口规范

联系方式:huxiongfei@zcool.com.cn

  • 请求方式:HTTP
  • 请求地址:https://api.hellorf.com/plus/
  • 公共参数

    参数 必选 类型及范围 说明
    client_id true string client_id
    nonce_str true string 时间戳
    sign true string 签名
    • 随机字符串参数:

      请求的接口中必须包含字段nonce_str,该字段以当前时间戳(秒)对应的字符串作为参数值

    • 参数签名:

      将所有接收到非空参数(包含随机数参数,不包含签名及密钥参数),按照参数名ASCII码从小到大排序,将参数对应的url编码作为字符串,形如

      client_id=4fiodcz8xjl6p8nbzfex2&keyword=云南&nonce_str=1473820208

      将得到的字符串拼接上密钥,形如

      client_id=4fiodcz8xjl6p8nbzfex2&keyword=云南&nonce_str=1473820208&client_secret=9b530aa85723c06a90879bee8f5096d7

      将得到的字符串用md5加密,得到32位小写加密串 sign=00ba2da066957662f43b668cf208e827

      {
          "client_id": "4fiodcz8xjl6p8nbzfex2",
          "keyword": "云南",
          "nonce_str": 1473820208,
          "sign": "00ba2da066957662f43b668cf208e827"
      }
  • 返回说明

    • 所有的返回数据以JSON格式提供
  • 请求失败范例
{
  "result": false,
  "message": '',
  "code": 1001
}
  • 请求成功范例
{
  "result": true,
  "data": {}
}

图片分类

  • 接口地址 image/categories

  • 请求方式 GET

  • 请求参数

  • 返回结果
{
  "result": true,
  "data": [
    {
      "id": 0,
      "name": "交通运输"
    },
    {
      "id": 16,
      "name": "科技"
    }
  ]
}
  • 接口地址 image/search

  • 请求方式 GET

  • 请求参数

    参数名 必选 类型 说明
    keyword true string 查询的关键字
    page true int 哪一页
    per_page false int 每页数量 最大值100
    category false string 分类ID
    image_type false string 图片类型:全部为空,照片 photo, 插画 illustration, 尺量图 vector
    color false string 颜色:#0ecb9b,#0bbbf5,#1f55f8,#0000ff,#7f00ff,#bf00ff,#ea06b1,#e72525,#f48700,#eca71d,#f1f129,#a9e418,#06d506,#000000
    height false int
    width false int
    orientation false string 图片方向: horizontal, vertical
    people_age false string 图片人物年龄段 infants, children, teenagers, 20s, 30s, 40s, 50s, 60s, older
    people_gender false string 性别 male, female, both
    people_number false string 人数
    people_model_released false string 时候含有肖像权
    sort false string 排序 newest, popular, relevance
  • 返回结果
{
  "result": true,
  "data": {
    "per_page": 100, //每页数量
    "total": 10763, //总数量
    "list": [
      {
        "id": "363488282",
        "aspect": 1.4984, //宽高比
        "title": "云南洱海",
        "large_thumb_url": "https://thumb9.shutterstock.com/thumb_large/131785/363488282/stock-photo-amazing-view-of-the-jade-dragon-snow-mountain-and-the-black-dragon-pool-lijiang-yunnan-province-363488282.jpg",
        "preview_url": "https://image.shutterstock.com/display_pic_with_logo/131785/363488282/stock-photo-amazing-view-of-the-jade-dragon-snow-mountain-and-the-black-dragon-pool-lijiang-yunnan-province-363488282.jpg"
      },
      {
        "id": 2234602517,
        "aspect": "1.50",
        "title": "云南洱海",
        "large_thumb_url": "http://ali.image.hellorf.com/hellorf/fd/7d/ae6ed152b5c0785e037fed7d7328/thumb_s_2234602517.jpg",
        "preview_url": "http://ali.image.hellorf.com/hellorf/fd/7d/ae6ed152b5c0785e037fed7d7328/thumb_b_2234602517.jpg"
      }
    ]
  }

图片详情

  • 接口地址 image/detail

  • 请求方式 GET

  • 请求参数

    参数名 必选 类型 说明
    image_id true string 图片ID
  • 返回结果
{
  "result": true,
  "data": {
    "image": {
      "id": 2234567973,
      "title": "云南洱海",
      "keywords": [
        "移动电话",
        "移動電話",
        "莫比尔",
        "行动",
        "蚨",
        "財富",
        "财",
        "财富",
        "财帛",
        "货",
        "资",
        "蹼"
      ],
      "aspect": "1.4980079681275",
      "image_type": "vector",   //类型 vector尺量图 photo图片
      "category_ids": [
        "12",
        "2"
      ],
      "large_thumb_url": "http://ali.image.hellorf.com/hellorf/6b/0f/be36d08b8498c9a619608c089115/thumb_s_2234567973.jpg",
      "preview_url": "http://ali.image.hellorf.com/hellorf/6b/0f/be36d08b8498c9a619608c089115/thumb_b_2234567973.jpg",
      "author": "Robert Broadhead"
    },
    "permissions": [ //权限列表
      {
        "id": 10,
        "name": "全用途",
        "text": "6016 x 4016 px (300dpi)",
        "size": "16.1MB",
        "size_level": 10,
        "width": 0,
        "height": 0,
        "dpi": 0
      },
      {
        "id": 11,
        "name": "数字用途",
        "text": "1000 x 668 px (0dpi)",
        "size": "570KB",
        "size_level": 5,
        "width": 0,
        "height": 0,
        "dpi": 0
      }
    ]
  }
}

购买图片

  • 接口地址 image/purchase

  • 请求方式 POST

  • 请求参数

    参数名 必选 类型 说明
    image_id true int 图片ID
    permission_id true int 权限ID
    warrant_name true string 授权用户名称
    third_user_id true string 第三方用户ID
  • 返回结果
{
  "result": true,
  "data": {
    "id": 52,
    "url": "http://download.hellorf.com/hellorf/6b/0f/be36d08b8498c9a619608c089115/hellorf_2234567973.jpg"  //下载地址
  }
}

热门专题列表

  • 接口地址 image/topic/hots

  • 请求方式 GET

  • 请求参数

    参数名 必选 类型 说明
  • 返回结果
{
  "result": true,
  "data": [
    {
      "id": 1,
      "title": "Night office",
      "cover_image":""
    },
    {
      "id": 2,
      "title": "双重曝光",
      "cover_image":""
    },
    {
      "id": 3,
      "title": "首页大图",
      "cover_image":""
    }
  ]
}

专题详情

  • 接口地址 image/topic/{$id}

  • 请求方式 GET

  • 请求参数

    参数名 必选 类型 说明
  • 返回结果
{
  "result": true,
  "data": {
    "id": 1,
    "title": "Night office",
    "list": [
      {
        "id": 131096951,
        "aspect": "1.5026",
        "description": "LONDON - JAN 31: people work in an office building in London on January 31, 2013. Full-time employees in the UK work longer hours than the EU average, according to the Office for National Statistics.",
        "large_thumb_url": "http://thumb109.test-ss.cn/thumb_large/595720/131096951/stock-photo-london-jan-people-work-in-an-office-building-in-london-on-january-full-time-131096951.jpg",
        "preview_url": "http://thumb109.test-ss.cn/display_pic_with_logo/595720/131096951/stock-photo-london-jan-people-work-in-an-office-building-in-london-on-january-full-time-131096951.jpg"
      },
      {
        "id": 110352362,
        "aspect": "1.5",
        "description": "office buildings",
        "large_thumb_url": "http://thumb106.test-ss.cn/thumb_large/496018/110352362/stock-photo-office-buildings-110352362.jpg",
        "preview_url": "http://thumb106.test-ss.cn/display_pic_with_logo/496018/110352362/stock-photo-office-buildings-110352362.jpg"
      }
    ]
  }
}

相似图片

  • 接口地址 image/{$id}/similar

  • 请求方式 GET

  • 请求参数

    参数名 必选 类型 说明
  • 返回结果
{
  "result": true,
  "data": [
    {
      "id": "314834948",
      "aspect": 1.5,
      "description": "Head and shoulders portrait of a young businesswoman smiling",
      "large_thumb_url": "http://thumb109.test-ss.cn/thumb_large/187633/314834948/stock-photo-head-and-shoulders-portrait-of-a-young-businesswoman-smiling-314834948.jpg",
      "preview_url": "http://thumb109.test-ss.cn/display_pic_with_logo/187633/314834948/stock-photo-head-and-shoulders-portrait-of-a-young-businesswoman-smiling-314834948.jpg"
    },
    {
      "id": "160580261",
      "aspect": 1.5,
      "description": "Beautiful businesswoman outdoor in the city",
      "large_thumb_url": "http://thumb103.test-ss.cn/thumb_large/210376/160580261/stock-photo-beautiful-businesswoman-outdoor-in-the-city-160580261.jpg",
      "preview_url": "http://thumb103.test-ss.cn/display_pic_with_logo/210376/160580261/stock-photo-beautiful-businesswoman-outdoor-in-the-city-160580261.jpg"
    }
  ]
}

我的购买记录

  • 接口地址 image/my-purchases

  • 请求方式 GET

  • 请求参数

    参数名 必选 类型 说明
    begin_at false TIMESTAMP 开始时间 例如:2017-01-01 23:23:23
    end_at false TIMESTAMP 结束时间 例如:2017-01-01 23:23:23
    is_download false int 是否下载 默认值全部 1是 2否
    per_page false int 每页数量 默认值 10
    page false int 哪一页 默认值第一页
  • 返回结果
{
  "result": true,
  "data": {
    "per_page": 10, //每页数量
    "total": 1, //总数量
    "list": [
      {
        "id": 35,  //购买ID
        "plus_user": { //购买用户
          "id": 14563341,
          "name": "xxx"
        },
        "real_plus_user": { //真实购买用户
          "id": 14563341,
          "name": "xxxx"
        },
        "third_user_id": "", //第三方用户ID
        "plus_permission": { //购买权限
          "id": 42,
          "name": "图片样片"
        },
        "able_id": 2234622970, //购买资源ID
        "able_type": "image", //购买资源名称
        "asset_type": "medium_jpg", //资源大小
        "warrant_name": "", //授权名称
        "download_at": "2017-02-25 00:32:18", //下载时间
        "created_at": "2017-02-25 00:32:18" // 购买时间
      }
    ]
  }
}

购买下载

  • 接口地址 image/purchase-download

  • 请求方式 GET

  • 请求参数

    参数名 必选 类型 说明
    purchase_id true int 购买ID
  • 返回结果
{
  "result": true,
  "data": {
    "url": "http://download.hellorf.com/hellorf/71/3f/3d23d8a247ff9adfea92c99cb9e4/hellorf_2234622970.jpg" //下载地址
  }
}