-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi-docs.html
More file actions
287 lines (270 loc) · 16.1 KB
/
api-docs.html
File metadata and controls
287 lines (270 loc) · 16.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<title>TruthWeb API Docs</title>
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" rel="stylesheet"/>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap" rel="stylesheet"/>
<style>
:root {
--primary-color: #000000;
--secondary-color: #FFFFFF;
--highlight-color: #CCCCCC;
--text-color: #FFFFFF;
--button-bg-color: #000000;
--button-text-color: #FFFFFF;
--button-hover-bg-color: #FFFFFF;
--button-hover-text-color: #000000;
--background-color: #FFFFFF;
}
body { background: var(--background-color); color: var(--primary-color); font-family: 'Poppins', sans-serif; overflow-x: hidden; }
.hero { height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; overflow: hidden; border: 2px solid var(--highlight-color); padding: 1rem; background: var(--primary-color); animation: fadeIn 1.5s ease-in-out; }
.hero::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent); opacity: 0.5; animation: float 6s infinite ease-in-out, pulseGlow 3s infinite alternate; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-20px); } }
@keyframes pulseGlow { 0% { opacity: 0.5; } 100% { opacity: 0.8; } }
@keyframes fadeIn { 0% { opacity: 0; } 100% { opacity: 1; } }
.glow-text { font-size: 2rem; font-weight: bold; color: var(--text-color); text-shadow: 0 0 10px var(--highlight-color), 0 0 20px var(--highlight-color); animation: glow 2s infinite alternate, bounce 3s infinite ease-in-out; }
@keyframes glow { 0% { text-shadow: 0 0 10px var(--highlight-color), 0 0 20px var(--highlight-color); } 100% { text-shadow: 0 0 20px var(--highlight-color), 0 0 30px var(--highlight-color); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.btn { background: var(--button-bg-color); color: var(--button-text-color); padding: 0.75rem 1.5rem; border: 2px solid var(--highlight-color); border-radius: 20px; cursor: pointer; transition: all 0.3s ease; animation: pulse 2s infinite; display: inline-block; text-align: center; text-decoration: none; }
.btn:hover { background: var(--button-hover-bg-color); color: var(--button-hover-text-color); transform: scale(1.1) rotate(3deg); }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }
footer { background: var(--primary-color); color: var(--text-color); text-align: center; padding: 2rem; animation: fadeIn 1.5s ease-in-out; }
html { scroll-behavior: smooth; }
.sticky-header { position: sticky; top: 0; z-index: 50; background: var(--primary-color); color: var(--text-color); transition: background 0.3s ease, color 0.3s ease; animation: slideDown 1s ease-in-out; display: flex; justify-content: space-between; align-items: center; height: 64px; padding: 0 1rem; }
.sticky-header.scrolled { background: var(--secondary-color); color: var(--primary-color); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); }
.sticky-header .logo-text { font-size: 1.5rem; font-weight: 700; transition: font-size 0.3s ease; }
.sticky-header.scrolled .logo-text { font-size: 1.25rem; }
.sticky-header .icon { color: inherit; }
@keyframes slideDown { 0% { transform: translateY(-100%); } 100% { transform: translateY(0); } }
.nav-item { transition: transform 0.3s ease; animation: fadeInUp 0.5s ease-in-out forwards; }
.nav-item:hover { transform: scale(1.1) translateY(-5px); }
@keyframes fadeInUp { 0% { opacity: 0; transform: translateY(20px); } 100% { opacity: 1; transform: translateY(0); } }
.nav-item:nth-child(1) { animation-delay: 0.1s; }
.nav-item:nth-child(2) { animation-delay: 0.2s; }
.nav-item:nth-child(3) { animation-delay: 0.3s; }
.nav-item:nth-child(4) { animation-delay: 0.4s; }
.nav-item:nth-child(5) { animation-delay: 0.5s; }
.nav-item:nth-child(6) { animation-delay: 0.6s; }
.nav-item:nth-child(7) { animation-delay: 0.7s; }
.floating-effect { transition: transform 0.3s ease; }
.floating-effect:hover { transform: translateY(-5px) rotate(5deg); }
pre, code { background: #f5f5f5; padding: 0.5rem; border-radius: 5px; font-family: 'Courier New', Courier, monospace; overflow-x: auto; }
.endpoint { border-bottom: 1px solid var(--highlight-color); padding-bottom: 1rem; margin-bottom: 2rem; }
</style>
</head>
<body>
<!-- Header Section -->
<header class="sticky-header">
<div class="flex items-center">
<a class="text-inherit mr-4 flex items-center" href="../index.html">
<span class="logo-text ml-2">TruthWeb</span>
</a>
</div>
<div class="flex items-center">
<a class="mr-4 icon floating-effect" href="../marketplace.html"><i class="fas fa-shopping-cart text-xl sm:text-2xl"></i></a>
<a class="mr-4 icon floating-effect" href="../profile.html"><i class="fas fa-user text-xl sm:text-2xl"></i></a>
<a class="icon floating-effect" href="../wallet.html"><i class="fas fa-wallet text-xl sm:text-2xl"></i></a>
</div>
</header>
<!-- Navigation Section -->
<nav class="bg-[var(--primary-color)] py-4">
<ul class="flex flex-wrap justify-center space-x-4">
<li class="nav-item"><a class="text-[var(--text-color)] hover:text-[var(--highlight-color)] floating-effect" href="../index.html">Home</a></li>
<li class="nav-item"><a class="text-[var(--text-color)] hover:text-[var(--highlight-color)] floating-effect" href="../marketplace.html">Marketplace</a></li>
<li class="nav-item"><a class="text-[var(--text-color)] hover:text-[var(--highlight-color)] floating-effect" href="../profile.html">Profile</a></li>
<li class="nav-item"><a class="text-[var(--text-color)] hover:text-[var(--highlight-color)] floating-effect" href="../wallet.html">Wallet</a></li>
<li class="nav-item"><a class="text-[var(--text-color)] hover:text-[var(--highlight-color)] floating-effect" href="../community.html">Community</a></li>
<li class="nav-item"><a class="text-[var(--text-color)] hover:text-[var(--highlight-color)] floating-effect" href="../developers.html">Developers</a></li>
<li class="nav-item"><a class="text-[var(--text-color)] hover:text-[var(--highlight-color)] floating-effect" href="../developer-portal.html">Developer Portal</a></li>
</ul>
</nav>
<!-- Hero Section -->
<div class="hero flex flex-col items-center justify-content">
<h1 class="glow-text fade-in text-5xl md:text-7xl font-bold">TruthWeb API Docs</h1>
<p class="text-xl mt-4 text-center fade-in" style="animation-delay: 0.5s; color: var(--text-color);">
Integrate Pi into Your Apps
</p>
</div>
<!-- API Documentation Section -->
<section id="api-docs" class="py-16 px-4 max-w-4xl mx-auto">
<h2 class="text-3xl font-bold mb-8">TruthWeb Open-Source API</h2>
<p class="mb-4">Welcome to the TruthWeb Open-Source API! This API allows developers to integrate Pi cryptocurrency into their applications, leveraging TruthWeb’s decentralized ecosystem.</p>
<h3 class="text-2xl font-semibold mb-4">Base URL</h3>
<p class="mb-4">All endpoints are relative to:</p>
<pre><code>https://api.truthweb.com/v1/</code></pre>
<p class="mb-4 text-sm italic">*Note*: Placeholder URL. Update with your deployment URL once live.</p>
<h3 class="text-2xl font-semibold mb-4">Authentication</h3>
<ul class="list-disc pl-6 mb-4">
<li><strong>API Key</strong>: Required for all requests. Register at the <a href="developer-portal.html" class="text-[var(--highlight-color)] hover:underline">TruthWeb Developer Portal</a>.</li>
<li><strong>Header</strong>: Include <code>Authorization: Bearer <your-api-key></code>.</li>
</ul>
<h3 class="text-2xl font-semibold mb-4">Endpoints</h3>
<div class="endpoint">
<h4 class="text-xl font-semibold mb-2">GET /profiles/{username}</h4>
<p class="mb-2">Retrieve a user’s public profile information.</p>
<p><strong>Method</strong>: <code>GET</code></p>
<p><strong>Path Parameters</strong>: <code>username</code> (string, required)</p>
<p><strong>Headers</strong>: <code>Authorization: Bearer <your-api-key></code></p>
<p><strong>Response</strong>:</p>
<pre><code class="language-json">{
"status": "success",
"data": {
"username": "pioneer123",
"display_name": "Pioneer John",
"bio": "Pi enthusiast and developer",
"created_at": "2025-03-05T10:00:00Z"
}
}</code></pre>
<p><strong>Status Codes</strong>:</p>
<ul class="list-disc pl-6">
<li><code>200 OK</code>: Profile retrieved.</li>
<li><code>404 Not Found</code>: Username not found.</li>
<li><code>401 Unauthorized</code>: Invalid API key.</li>
</ul>
</div>
<div class="endpoint">
<h4 class="text-xl font-semibold mb-2">GET /wallet/{username}/balance</h4>
<p class="mb-2">Check a user’s Pi balance.</p>
<p><strong>Method</strong>: <code>GET</code></p>
<p><strong>Path Parameters</strong>: <code>username</code> (string, required)</p>
<p><strong>Headers</strong>: <code>Authorization: Bearer <your-api-key></code></p>
<p><strong>Response</strong>:</p>
<pre><code class="language-json">{
"status": "success",
"data": {
"username": "pioneer123",
"balance_pi": 150.75,
"updated_at": "2025-03-05T12:00:00Z"
}
}</code></pre>
<p><strong>Status Codes</strong>:</p>
<ul class="list-disc pl-6">
<li><code>200 OK</code>: Balance retrieved.</li>
<li><code>404 Not Found</code>: User not found.</li>
<li><code>401 Unauthorized</code>: Invalid API key.</li>
</ul>
</div>
<div class="endpoint">
<h4 class="text-xl font-semibold mb-2">POST /wallet/transfer</h4>
<p class="mb-2">Initiate a Pi transfer between users.</p>
<p><strong>Method</strong>: <code>POST</code></p>
<p><strong>Headers</strong>: <code>Authorization: Bearer <your-api-key></code>, <code>Content-Type: application/json</code></p>
<p><strong>Body</strong>:</p>
<pre><code class="language-json">{
"from_username": "pioneer123",
"to_username": "pioneer456",
"amount_pi": 10.50,
"description": "Payment for eBook"
}</code></pre>
<p><strong>Response</strong>:</p>
<pre><code class="language-json">{
"status": "success",
"data": {
"transaction_id": "txn_123456789",
"from_username": "pioneer123",
"to_username": "pioneer456",
"amount_pi": 10.50,
"timestamp": "2025-03-05T12:05:00Z"
}
}</code></pre>
<p><strong>Status Codes</strong>:</p>
<ul class="list-disc pl-6">
<li><code>201 Created</code>: Transfer initiated.</li>
<li><code>400 Bad Request</code>: Invalid parameters.</li>
<li><code>401 Unauthorized</code>: Invalid API key.</li>
</ul>
</div>
<div class="endpoint">
<h4 class="text-xl font-semibold mb-2">GET /marketplace/listings</h4>
<p class="mb-2">List available marketplace items.</p>
<p><strong>Method</strong>: <code>GET</code></p>
<p><strong>Query Parameters</strong>:</p>
<ul class="list-disc pl-6 mb-2">
<li><code>category</code> (string, optional): Filter by category (e.g., "digital").</li>
<li><code>limit</code> (integer, optional): Number of results (default: 10).</li>
<li><code>offset</code> (integer, optional): Pagination offset (default: 0).</li>
</ul>
<p><strong>Headers</strong>: <code>Authorization: Bearer <your-api-key></code></p>
<p><strong>Response</strong>:</p>
<pre><code class="language-json">{
"status": "success",
"data": [
{
"id": "lst_001",
"title": "Pi Programming eBook",
"category": "digital",
"price_pi": 5.00,
"seller_username": "pioneer789",
"created_at": "2025-03-01T09:00:00Z"
},
{
"id": "lst_002",
"title": "Handmade Pi Mug",
"category": "physical",
"price_pi": 15.00,
"seller_username": "pioneer456",
"created_at": "2025-03-02T14:00:00Z"
}
],
"meta": {
"total": 25,
"limit": 10,
"offset": 0
}
}</code></pre>
<p><strong>Status Codes</strong>:</p>
<ul class="list-disc pl-6">
<li><code>200 OK</code>: Listings retrieved.</li>
<li><code>401 Unauthorized</code>: Invalid API key.</li>
</ul>
</div>
<h3 class="text-2xl font-semibold mb-4">Error Handling</h3>
<p class="mb-2">Errors follow this format:</p>
<pre><code class="language-json">{
"status": "error",
"message": "Invalid API key",
"code": 401
}</code></pre>
<h3 class="text-2xl font-semibold mb-4">Rate Limits</h3>
<p class="mb-4">100 requests per minute per API key. Check <code>X-RateLimit-Remaining</code> header.</p>
<h3 class="text-2xl font-semibold mb-4">Getting Started</h3>
<ol class="list-decimal pl-6 mb-4">
<li><strong>Register</strong>: Get your API key at the <a href="developer-portal.html" class="text-[var(--highlight-color)] hover:underline">TruthWeb Developer Portal</a>.</li>
<li><strong>Explore</strong>: Clone the <a href="https://github.com/username/TruthWeb" target="_blank" class="text-[var(--highlight-color)] hover:underline">TruthWeb GitHub repo</a>.</li>
<li><strong>Contribute</strong>: Submit pull requests—it’s open-source!</li>
</ol>
<h3 class="text-2xl font-semibold mb-4">Support</h3>
<p class="mb-4">Report issues on <a href="https://github.com/username/TruthWeb/issues" target="_blank" class="text-[var(--highlight-color)] hover:underline">GitHub Issues</a> or email <a href="mailto:support@truthweb.com" class="text-[var(--highlight-color)] hover:underline">support@truthweb.com</a>.</p>
<p class="text-sm italic mt-8">Last Updated: March 05, 2025</p>
</section>
<!-- Footer -->
<footer class="bg-[var(--primary-color)] py-8">
<div class="container mx-auto text-center">
<div class="mb-4">
<a class="text-[var(--text-color)] mx-2 floating-effect" href="https://www.facebook.com/reimaginetruthofficial/" target="_blank"><i class="fab fa-facebook-f"></i></a>
<a class="text-[var(--text-color)] mx-2 floating-effect" href="https://x.com/reimagine_truth" target="_blank"><i class="fab fa-twitter"></i></a>
<a class="text-[var(--text-color)] mx-2 floating-effect" href="https://t.me/TruthWebOfficial" target="_blank"><i class="fab fa-telegram"></i></a>
<a class="text-[var(--text-color)] mx-2 floating-effect" href="https://www.youtube.com/@ReimagineTruth" target="_blank"><i class="fab fa-youtube"></i></a>
<a class="text-[var(--text-color)] mx-2 floating-effect" href="https://github.com/username/TruthWeb" target="_blank"><i class="fab fa-github"></i></a>
</div>
<p class="text-[var(--text-color)] mb-4">© 2025 TruthWeb. All rights reserved.</p>
<div class="text-[var(--text-color)] text-sm">
<a href="about.html" class="mx-2 hover:text-[var(--highlight-color)]">About Us</a> |
<a href="terms.html" class="mx-2 hover:text-[var(--highlight-color)]">Terms & Conditions</a> |
<a href="privacy.html" class="mx-2 hover:text-[var(--highlight-color)]">Privacy Policy</a> |
<a href="contact.html" class="mx-2 hover:text-[var(--highlight-color)]">Contact</a>
</div>
</div>
</footer>
<!-- Scripts -->
<script>
window.addEventListener('scroll', function() {
const header = document.querySelector('.sticky-header');
if (window.scrollY > 50) { header.classList.add('scrolled'); } else { header.classList.remove('scrolled'); }
});
</script>
</body>
</html>