@unavatar/core 3.16.0 → 3.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -20
- package/package.json +1 -1
- package/src/providers/facebook.js +8 -0
- package/src/providers/index.js +2 -0
package/README.md
CHANGED
|
@@ -82,38 +82,34 @@ The anonymous requests works without authentication. They are limited to 25 requ
|
|
|
82
82
|
For [PRO](https://unavatar.io/checkout) users, the requests must include the API key as the `x-api-key` request header:
|
|
83
83
|
|
|
84
84
|
```bash
|
|
85
|
-
curl -H "x-api-key: YOUR_API_KEY"
|
|
85
|
+
curl "https://unavatar.io/github/kikobeats" -H "x-api-key: YOUR_API_KEY"
|
|
86
86
|
```
|
|
87
87
|
|
|
88
88
|
```javascript
|
|
89
|
-
await fetch('https://
|
|
89
|
+
await fetch('https://unavatar.io/github/kikobeats', {
|
|
90
90
|
headers: {
|
|
91
|
-
'x-api-key':
|
|
91
|
+
'x-api-key': 'YOUR_API_KEY'
|
|
92
92
|
}
|
|
93
93
|
})
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
```python
|
|
97
|
-
import os
|
|
98
97
|
import requests
|
|
99
98
|
|
|
100
99
|
response = requests.get(
|
|
101
|
-
'https://
|
|
102
|
-
headers={'x-api-key':
|
|
100
|
+
'https://unavatar.io/github/kikobeats',
|
|
101
|
+
headers={'x-api-key': 'YOUR_API_KEY'}
|
|
103
102
|
)
|
|
104
103
|
```
|
|
105
104
|
|
|
106
105
|
```golang
|
|
107
106
|
package main
|
|
108
107
|
|
|
109
|
-
import
|
|
110
|
-
"net/http"
|
|
111
|
-
"os"
|
|
112
|
-
)
|
|
108
|
+
import "net/http"
|
|
113
109
|
|
|
114
110
|
func main() {
|
|
115
|
-
req, _ := http.NewRequest("GET", "https://
|
|
116
|
-
req.Header.Set("x-api-key",
|
|
111
|
+
req, _ := http.NewRequest("GET", "https://unavatar.io/github/kikobeats", nil)
|
|
112
|
+
req.Header.Set("x-api-key", "YOUR_API_KEY")
|
|
117
113
|
|
|
118
114
|
resp, _ := http.DefaultClient.Do(req)
|
|
119
115
|
defer resp.Body.Close()
|
|
@@ -124,9 +120,9 @@ func main() {
|
|
|
124
120
|
require 'net/http'
|
|
125
121
|
require 'uri'
|
|
126
122
|
|
|
127
|
-
uri = URI('https://
|
|
123
|
+
uri = URI('https://unavatar.io/github/kikobeats')
|
|
128
124
|
request = Net::HTTP::Get.new(uri)
|
|
129
|
-
request['x-api-key'] =
|
|
125
|
+
request['x-api-key'] = 'YOUR_API_KEY'
|
|
130
126
|
|
|
131
127
|
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
|
|
132
128
|
http.request(request)
|
|
@@ -134,10 +130,10 @@ end
|
|
|
134
130
|
```
|
|
135
131
|
|
|
136
132
|
```php
|
|
137
|
-
$ch = curl_init('https://
|
|
133
|
+
$ch = curl_init('https://unavatar.io/github/kikobeats');
|
|
138
134
|
|
|
139
135
|
curl_setopt($ch, CURLOPT_HTTPHEADER, [
|
|
140
|
-
'x-api-key: '
|
|
136
|
+
'x-api-key: YOUR_API_KEY',
|
|
141
137
|
]);
|
|
142
138
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
143
139
|
|
|
@@ -156,7 +152,7 @@ Rate limit status can be verified using these response headers:
|
|
|
156
152
|
| `x-rate-limit-reset` | UTC epoch seconds when the current window resets |
|
|
157
153
|
|
|
158
154
|
```bash
|
|
159
|
-
$ curl -I https://
|
|
155
|
+
$ curl -I https://unavatar.io/github/kikobeats
|
|
160
156
|
|
|
161
157
|
x-rate-limit-limit: 25
|
|
162
158
|
x-rate-limit-remaining: 24
|
|
@@ -186,7 +182,7 @@ Every request has a cost in tokens (**\$0.005 per token**) based on the proxy ti
|
|
|
186
182
|
The proxy tier used is returned in the `x-proxy-tier` response header, and the total cost in the `x-unavatar-cost` header.
|
|
187
183
|
|
|
188
184
|
```bash
|
|
189
|
-
$ curl -I -H "x-api-key: YOUR_API_KEY" https://
|
|
185
|
+
$ curl -I -H "x-api-key: YOUR_API_KEY" https://unavatar.io/instagram/kikobeats
|
|
190
186
|
|
|
191
187
|
x-pricing-tier: pro
|
|
192
188
|
x-proxy-tier: origin
|
|
@@ -220,7 +216,7 @@ To check the cache status in real requests, inspect these response headers:
|
|
|
220
216
|
| `cache-control` | Shows cache policy and effective TTL (for example `public, max-age=3600` for `ttl=1h`). |
|
|
221
217
|
|
|
222
218
|
```bash
|
|
223
|
-
$ curl -I -H "x-api-key: YOUR_API_KEY" "https://
|
|
219
|
+
$ curl -I -H "x-api-key: YOUR_API_KEY" "https://unavatar.io/github/kikobeats?ttl=1h"
|
|
224
220
|
|
|
225
221
|
cache-control: public, max-age=3600
|
|
226
222
|
x-cache-status: HIT
|
|
@@ -658,7 +654,7 @@ These headers help you understand pricing, limits, and request diagnostics.
|
|
|
658
654
|
| `retry-after` | Seconds until rate limit resets (only on 429 responses) |
|
|
659
655
|
|
|
660
656
|
```bash
|
|
661
|
-
$ curl -I -H "x-api-key: YOUR_API_KEY" https://
|
|
657
|
+
$ curl -I -H "x-api-key: YOUR_API_KEY" https://unavatar.io/github/kikobeats
|
|
662
658
|
|
|
663
659
|
x-pricing-tier: pro
|
|
664
660
|
x-timestamp: 1744209600
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@unavatar/core",
|
|
3
3
|
"description": "Get unified user avatar from social networks, including Instagram, SoundCloud, Telegram, Twitter, YouTube & more.",
|
|
4
4
|
"homepage": "https://unavatar.io",
|
|
5
|
-
"version": "3.
|
|
5
|
+
"version": "3.17.1",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./src/index.js",
|
package/src/providers/index.js
CHANGED
|
@@ -9,6 +9,7 @@ const providersBy = {
|
|
|
9
9
|
'deviantart',
|
|
10
10
|
'discord',
|
|
11
11
|
'dribbble',
|
|
12
|
+
'facebook',
|
|
12
13
|
'github',
|
|
13
14
|
'gitlab',
|
|
14
15
|
'instagram',
|
|
@@ -48,6 +49,7 @@ module.exports = ctx => {
|
|
|
48
49
|
discord: require('./discord')(ctx),
|
|
49
50
|
dribbble: require('./dribbble')(ctx),
|
|
50
51
|
duckduckgo: require('./duckduckgo')(ctx),
|
|
52
|
+
facebook: require('./facebook')(ctx),
|
|
51
53
|
github: require('./github')(ctx),
|
|
52
54
|
gitlab: require('./gitlab')(ctx),
|
|
53
55
|
google: require('./google')(ctx),
|