api_analytics 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +55 -13
- data/lib/api_analytics/version.rb +1 -1
- data/lib/api_analytics.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dea99b41bffb7846c39fc219d7736efda2232246b386a70c4dca5d9fa8f235a1
|
4
|
+
data.tar.gz: 0c7f969e0b082cbc2de60bcd09f58a7c220969dea4a1f091ef93e0159aa5afaf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53885410b819a0f3152ba162d3c11bb24671be31e03fc3d02abe3b3646d5e9a521474027e7d03c8517cfab1f0016fb0ffc952fe8b544db88a885386689878244
|
7
|
+
data.tar.gz: 9599df056ba7cd60560a71617b4dcc38579491abbfce70efc672906443e2ecd4ccf30bdda9b47b86624f171a157c5110e4b40d19b8e7802342b33a812cab3fcc
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -4,13 +4,13 @@ A lightweight API analytics solution, complete with a dashboard.
|
|
4
4
|
|
5
5
|
## Getting Started
|
6
6
|
|
7
|
-
### 1. Generate
|
7
|
+
### 1. Generate an API key
|
8
8
|
|
9
|
-
Head to https://
|
9
|
+
Head to https://apianalytics.dev/generate to generate your unique API key with a single click. This key is used to monitor your specific API and should be stored privately. It's also required in order to view your API analytics dashboard.
|
10
10
|
|
11
11
|
### 2. Add middleware to your API
|
12
12
|
|
13
|
-
Add our lightweight middleware to your API. Almost all processing is handled by our servers so there
|
13
|
+
Add our lightweight middleware to your API. Almost all processing is handled by our servers so there is minimal impact on the performance of your API.
|
14
14
|
|
15
15
|
```bash
|
16
16
|
gem install api_analytics
|
@@ -55,33 +55,58 @@ end
|
|
55
55
|
|
56
56
|
### 3. View your analytics
|
57
57
|
|
58
|
-
Your API will now log and store incoming request data on all valid routes. Your logged data can be viewed using two methods:
|
58
|
+
Your API will now log and store incoming request data on all valid routes. Your logged data can be viewed using two methods:
|
59
59
|
|
60
|
-
|
60
|
+
1. Through visualizations and statistics on our dashboard
|
61
|
+
2. Accessed directly via our data API
|
62
|
+
|
63
|
+
You can use the same API key across multiple APIs, but all your data will appear in the same dashboard. We recommend generating a new API key for each additional API server you want analytics for.
|
61
64
|
|
62
65
|
#### Dashboard
|
63
66
|
|
64
|
-
Head to https://
|
67
|
+
Head to https://apianalytics.dev/dashboard and paste in your API key to access your dashboard.
|
65
68
|
|
66
|
-
Demo: https://
|
69
|
+
Demo: https://apianalytics.dev/dashboard/demo
|
67
70
|
|
68
|
-
![Dashboard](https://user-images.githubusercontent.com/41476809/
|
71
|
+
![Dashboard](https://user-images.githubusercontent.com/41476809/211800529-a84a0aa3-70c9-47d4-aa0d-7f9bbd3bc9b5.png)
|
69
72
|
|
70
73
|
#### Data API
|
71
74
|
|
72
|
-
Logged data for all requests can be accessed via our API. Simply send a GET request to `https://
|
75
|
+
Logged data for all requests can be accessed via our REST API. Simply send a GET request to `https://apianalytics-server.com/api/data` with your API key set as `X-AUTH-TOKEN` in headers.
|
76
|
+
|
77
|
+
##### Python
|
73
78
|
|
74
79
|
```py
|
75
80
|
import requests
|
76
81
|
|
77
82
|
headers = {
|
78
|
-
"
|
83
|
+
"X-AUTH-TOKEN": <API-KEY>
|
79
84
|
}
|
80
85
|
|
81
|
-
response = requests.get("https://
|
86
|
+
response = requests.get("https://apianalytics-server.com/api/data", headers=headers)
|
82
87
|
print(response.json())
|
83
88
|
```
|
84
89
|
|
90
|
+
##### Node.js
|
91
|
+
|
92
|
+
```js
|
93
|
+
fetch("https://apianalytics-server.com/api/data", {
|
94
|
+
headers: { "X-AUTH-TOKEN": <API-KEY> },
|
95
|
+
})
|
96
|
+
.then((response) => {
|
97
|
+
return response.json();
|
98
|
+
})
|
99
|
+
.then((data) => {
|
100
|
+
console.log(data);
|
101
|
+
});
|
102
|
+
```
|
103
|
+
|
104
|
+
##### cURL
|
105
|
+
|
106
|
+
```bash
|
107
|
+
curl --header "X-AUTH-TOKEN: <API-KEY>" https://apianalytics-server.com/api/data
|
108
|
+
```
|
109
|
+
|
85
110
|
## Monitoring (coming soon)
|
86
111
|
|
87
112
|
Opt-in active API monitoring is coming soon. Our servers will regularly ping your API endpoints to monitor uptime and response time. Optional email alerts to notify you when your endpoints are down can be subscribed to.
|
@@ -104,8 +129,25 @@ For any given request to your API, data recorded is limited to:
|
|
104
129
|
- API hostname
|
105
130
|
- API framework (FastAPI, Flask, Express etc.)
|
106
131
|
|
107
|
-
Data collected is only ever used to populate your analytics dashboard.
|
132
|
+
Data collected is only ever used to populate your analytics dashboard. All data stored is anonymous, with the API key the only link between you and your logged request data. Should you lose your API key, you will have no method to access your API analytics.
|
108
133
|
|
109
134
|
### Delete Data
|
110
135
|
|
111
|
-
At any time, you can delete all stored data associated with your API key by going to https://
|
136
|
+
At any time, you can delete all stored data associated with your API key by going to https://apianalytics.dev/delete and entering your API key.
|
137
|
+
|
138
|
+
API keys and their associated API request data are scheduled be deleted after 1 year of inactivity.
|
139
|
+
|
140
|
+
## Development
|
141
|
+
|
142
|
+
This project is still in the early stages of development and bugs are to be expected.
|
143
|
+
|
144
|
+
## Contributions
|
145
|
+
|
146
|
+
Contributions, issues and feature requests are welcome.
|
147
|
+
|
148
|
+
- Fork it (https://github.com/tom-draper/api-analytics)
|
149
|
+
- Create your feature branch (`git checkout -b my-new-feature`)
|
150
|
+
- Commit your changes (`git commit -am 'Add some feature'`)
|
151
|
+
- Push to the branch (`git push origin my-new-feature`)
|
152
|
+
- Create a new Pull Request
|
153
|
+
|
data/lib/api_analytics.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: api_analytics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Draper
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Monitoring and analytics for API applications.
|
14
14
|
email:
|