mirror of
https://github.com/zhigang1992/favicongrabber.com.git
synced 2026-04-30 10:31:39 +08:00
Added API.md
This commit is contained in:
45
server/api/API.md
Normal file
45
server/api/API.md
Normal file
@@ -0,0 +1,45 @@
|
||||
# API
|
||||
|
||||
All responses are returned as JSON over HTTP.
|
||||
|
||||
## Root Endpoint
|
||||
|
||||
The root endpoint for the API is http://favicongrabber.com/api/
|
||||
|
||||
## Grab
|
||||
|
||||
```
|
||||
GET /api/grab/:domain
|
||||
```
|
||||
|
||||
For instance, to grab favicons of GitHub's index page:
|
||||
|
||||
http://favicongrabber.com/api/grab/github.com
|
||||
|
||||
```json
|
||||
{
|
||||
"domain": "github.com",
|
||||
"icons": [
|
||||
{
|
||||
"src": "https://assets-cdn.github.com/favicon.ico",
|
||||
"type": "image/x-icon"
|
||||
},
|
||||
{
|
||||
"src": "https://assets-cdn.github.com/pinned-octocat.svg"
|
||||
},
|
||||
{
|
||||
"src": "https://github.com/fluidicon.png"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
Error messages have the following format:
|
||||
|
||||
```json
|
||||
{
|
||||
"error": "Unresolved domain \"example.test\""
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user