API上传

API 使用教程

无名图床提供API上传方式,使用API您可以直接将您网站的图片托管到无名图床
下面是API的详细使用教程

无名图床API key

API Key还是禁用了吧. 用户重复传图,无法处理
ce2bf6152cb41fea7939651cf9d51ef2

注意: 使用API上传的图片,全部是公开访问,无法加密,无法管理.
如果有加密需求,请注册用户,在线管理.
为防止滥用,每个IP限制200张图片/小时

请求方法说明:

API支持POST 或者 GET 请求方式.
但是,GET由于有大小限制,一般使用POST方法上传文件.

请求URL格式

http://mysite.com/api/1/action/

请求参数

key 必须,无名图床的API key: ce2bf6152cb41fea7939651cf9d51ef2
action 行动方式,默认上传 [values: upload].
source 填写图片URL或者 base64 编码后的字符串. 也可以使用 FILES["source"] .
format 返回格式,默认json. [values: json (default), redirect, txt].

API请求示例总览

POST https://whoimg.com/api/1/upload/?key=12345&source=http://somewebsite/someimage.jpg&format=json

API响应示例总览

format 参数说明

json 默认显示JSON 格式. [default]
txt 以文本/纯文本格式返回图片直接网址
redirect 重定向到图片查看器网址

当使用JSON时,响应将包含标题状态代码,以便您可以轻松注意到请求是否正确。 它还会输出status_txt和status_code属性

JSON响应示例

{
		"status_code": 200,
		"success": {
			"message": "image uploaded",
			"code": 200
		},
		"image": {
			"name": "example",
			"extension": "png",
			"size": 53237,
			"width": 1151,
			"height": 898,
			"date": "2014-06-04 15:32:33",
			"date_gmt": "2014-06-04 19:32:33",
			"storage_id": null,
			"description": null,
			"nsfw": "0",
			"md5": "c684350d722c956c362ab70299735830",
			"storage": "datefolder",
			"original_filename": "example.png",
			"original_exifdata": null,
			"views": "0",
			"id_encoded": "L",
			"filename": "example.png",
			"ratio": 1.2817371937639,
			"size_formatted": "52 KB",
			"mime": "image/png",
			"bits": 8,
			"channels": null,
			"url": "http://127.0.0.1/images/2014/06/04/example.png",
			"url_viewer": "http://127.0.0.1/image/L",
			"thumb": {
				"filename": "example.th.png",
				"name": "example.th",
				"width": 160,
				"height": 160,
				"ratio": 1,
				"size": 17848,
				"size_formatted": "17.4 KB",
				"mime": "image/png",
				"extension": "png",
				"bits": 8,
				"channels": null,
				"url": "http://127.0.0.1/images/2014/06/04/example.th.png"
			},
			"medium": {
				"filename": "example.md.png",
				"name": "example.md",
				"width": 500,
				"height": 390,
				"ratio": 1.2820512820513,
				"size": 104448,
				"size_formatted": "102 KB",
				"mime": "image/png",
				"extension": "png",
				"bits": 8,
				"channels": null,
				"url": "http://127.0.0.1/images/2014/06/04/example.md.png"
			},
			"views_label": "views",
			"display_url": "http://127.0.0.1/images/2014/06/04/example.md.png",
			"how_long_ago": "moments ago"
		},
		"status_txt": "OK"
	}

txt响应示例

http://127.0.0.1/images/2014/06/04/example.png

©2017 - 2019 无名图床 | whoimg.com 版权所有

无名图床提供免费的图片上传和分享服务,支持外链

无名图床使用云存储技术,全球CDN加速,无限制流量

Edit or resize any image by clicking the image preview
Edit any image by touching the image preview
You can add more images from your computer or add image URLs.
You can add more images from your device, take a picture or add image URLs.
Uploading 0 image (0% complete)
The queue is being uploaded, it should take just a few seconds to complete.
Upload complete
Uploaded content added to . You can create a new album with the content just uploaded.
Uploaded content added to .
You can create an account or sign in to save this content into your account.
No image have been uploaded
Some errors have occured and the system couldn't process your request.
    or cancelcancel remaining
    Note: Some images couldn't be uploaded. learn more
    Check the error report for more information.
    JPG PNG BMP 10 MB