mirror of
https://gitlab.com/2-chainz/2-chainz-rest-site.git
synced 2025-06-16 15:17:24 +00:00
added more detailed usage instructions
This commit is contained in:
parent
b79d8a71e6
commit
b5676962d4
76
index.html
76
index.html
@ -105,35 +105,63 @@
|
|||||||
<h2>Usage</h2>
|
<h2>Usage</h2>
|
||||||
</header>
|
</header>
|
||||||
<details open>
|
<details open>
|
||||||
<summary>Getting Quotes</summary>
|
<summary>Quote</summary>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The <code>quotes</code> endpoint can be accessed here:
|
Returns a random 2 Chainz Quote in <code>json</code> format like the
|
||||||
<code
|
following example:
|
||||||
><a href="https://api.chainz.rest/quote"
|
|
||||||
>https://api.chainz.rest/quote</a
|
|
||||||
></code
|
|
||||||
>
|
|
||||||
</p>
|
</p>
|
||||||
<p>
|
|
||||||
This endpoint returns a 2 Chainz quote, and can optionally take the
|
<p>send a <code>get</code> request to <code></code></p>
|
||||||
<code>batch</code> parameter which allows requesting more than one
|
|
||||||
quote at a time.
|
<pre><code>{
|
||||||
</p></details
|
"quote": "I got a pocket full of money, it got me walking all slew-foot"
|
||||||
>
|
}</code></pre>
|
||||||
|
|
||||||
|
<details style="margin-left: 5%;">
|
||||||
|
<summary>Parameters</summary>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
This endpoint also supports an optional <code>batch</code> parameter
|
||||||
|
to get more than one quote per request. Maximum quotes that the
|
||||||
|
endpoint will return is the amount of quotes in
|
||||||
|
<a
|
||||||
|
href="https://gitlab.com/2-chainz/2-chainz-rest/-/blob/master/quote/quotes.py"
|
||||||
|
>quotes.py</a
|
||||||
|
>
|
||||||
|
and is subject to change. An example return from
|
||||||
|
<a href="https://api.chainz.rest/quote?batch=2"
|
||||||
|
>https://api.chainz.rest/quote?batch=2</a
|
||||||
|
>:
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<pre><code class="json">{
|
||||||
|
  "quotes": [
|
||||||
|
    "I'm in the kitchen. Yams errrrrwhere.",
|
||||||
|
    "Started from the trap, now I rap"
|
||||||
|
  ]
|
||||||
|
}</code></pre>
|
||||||
|
</details>
|
||||||
|
</details>
|
||||||
|
|
||||||
<details
|
<details
|
||||||
><summary>Aliases</summary>
|
><summary>Alias</summary>
|
||||||
<p>
|
<p>
|
||||||
2 Chainz has gone by many different names throughout his career and
|
Returns a random 2 Chainz alias in <code>json</code> format. The
|
||||||
this endpoint lets you request a random <code>alias</code> that Tity
|
return values are weighted and a full list can be seen in
|
||||||
Boi has used over the years. Can be accessed here:
|
<a
|
||||||
<code
|
href="https://gitlab.com/2-chainz/2-chainz-rest/-/blob/master/alias/aliases.py"
|
||||||
><a href="https://api.chainz.rest/alias"
|
>aliases.py</a
|
||||||
>https://api.chainz.rest/alias</a
|
>.
|
||||||
></code
|
</p>
|
||||||
>
|
<p>
|
||||||
</p></details
|
send a <code>get</code> request to
|
||||||
>
|
<code>https://api.chainz.rest/alias</code>
|
||||||
|
</p>
|
||||||
|
<pre><code>{
|
||||||
|
"alias": "Dos Cadenas"
|
||||||
|
}</code></pre>
|
||||||
|
</details>
|
||||||
<hr />
|
<hr />
|
||||||
<section>
|
<section>
|
||||||
<header>
|
<header>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user