<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.fintechlab.unibocconi.eu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=3126123</id>
	<title>Fintech Lab Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.fintechlab.unibocconi.eu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=3126123"/>
	<link rel="alternate" type="text/html" href="https://wiki.fintechlab.unibocconi.eu/wiki/Special:Contributions/3126123"/>
	<updated>2026-04-17T12:47:35Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://wiki.fintechlab.unibocconi.eu/index.php?title=Cryptocurrency_data_collection_in_python&amp;diff=314</id>
		<title>Cryptocurrency data collection in python</title>
		<link rel="alternate" type="text/html" href="https://wiki.fintechlab.unibocconi.eu/index.php?title=Cryptocurrency_data_collection_in_python&amp;diff=314"/>
		<updated>2023-02-27T23:13:06Z</updated>

		<summary type="html">&lt;p&gt;3126123: Created page with &amp;quot;In this document, we provide a brief tutorial on using CoinMarketCap Pro API to access cryptocurrency data. We&amp;#039;ll display how to access exchange trading volume and cryptocurre...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In this document, we provide a brief tutorial on using CoinMarketCap Pro API to access cryptocurrency data. We&#039;ll display how to access exchange trading volume and cryptocurrency OHLCV data, but using other endpoints is essentially similar. You can find the CMC API documentation [https://coinmarketcap.com/api/documentation/v1/#section/Introduction here].&lt;br /&gt;
&lt;br /&gt;
The only dependencies necessary to run the illustration are &amp;lt;code&amp;gt;load_dotenv&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;requests&amp;lt;/code&amp;gt;.&lt;br /&gt;
[[File:Snip1.png|center|346x346px]]&lt;br /&gt;
Define a class which will contain the logic for accessing the API. The user can either pass &amp;lt;code&amp;gt;api_key&amp;lt;/code&amp;gt; parameter directly to the &amp;lt;code&amp;gt;__init__&amp;lt;/code&amp;gt; method or set it as an environment variable. The implementation supports &amp;lt;code&amp;gt;.env&amp;lt;/code&amp;gt; files as &amp;lt;code&amp;gt;load_dotenv&amp;lt;/code&amp;gt; is called. Make sure to manually create the env file populated with your API key. The base URL is automatically selected based on the existence of a paid API key, but can be overridden if the parameter is set by the user.&lt;br /&gt;
[[File:Snip2.png|center]]&lt;br /&gt;
Add the &amp;lt;code&amp;gt;session&amp;lt;/code&amp;gt; property, which persists the API key across all requests. Furthermore, a &amp;lt;code&amp;gt;Session&amp;lt;/code&amp;gt; instance uses a connection pool and reuses the TCP connection, which will lead to a significant increase in performance.&lt;br /&gt;
[[File:Snip3.png|center]]&lt;br /&gt;
Define a private method, &amp;lt;code&amp;gt;__make_req&amp;lt;/code&amp;gt;, which will be used by public methods to send requests to the API. &amp;lt;code&amp;gt;__make_req&amp;lt;/code&amp;gt; receives the endpoint address, a dictionary of parameters, which must comply the format explained in the endoint&#039;s documentation, and the version of the endpoint. If the API returns an error, it&#039;ll be automatically raised. Otherwise, the response will be converted to a &amp;lt;code&amp;gt;dict&amp;lt;/code&amp;gt; object and returned.&lt;br /&gt;
[[File:Snip4.png|center]]&lt;br /&gt;
Time to add the public methods. We&#039;ll define methods for cryptocurrency OHLCV and exchange quotes endpoints.&lt;br /&gt;
[[File:Snip5.png|center]]&lt;br /&gt;
The user can access the data now.&lt;br /&gt;
[[File:Snip6.png|center]]&lt;br /&gt;
The code results in:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{&#039;status&#039;: {&#039;timestamp&#039;: &#039;2022-09-06T14:55:37.113Z&#039;,  &#039;error_code&#039;: 0,  &#039;error_message&#039;: None,  &#039;elapsed&#039;: 22,  &#039;credit_count&#039;: 1,  &#039;notice&#039;: None}, &#039;data&#039;: {&#039;binance&#039;: {&#039;quotes&#039;: [{&#039;timestamp&#039;: &#039;2022-09-06T14:50:12.000Z&#039;,     &#039;quote&#039;: {&#039;USD&#039;: {&#039;volume_24h&#039;: 73522805073.14716,       &#039;timestamp&#039;: &#039;2022-09-06T14:50:12.000Z&#039;}},     &#039;num_market_pairs&#039;: 1702}],   &#039;id&#039;: 270,   &#039;name&#039;: &#039;Binance&#039;,   &#039;slug&#039;: &#039;binance&#039;},  &#039;kraken&#039;: {&#039;quotes&#039;: [{&#039;timestamp&#039;: &#039;2022-09-06T14:50:11.000Z&#039;,     &#039;quote&#039;: {&#039;USD&#039;: {&#039;volume_24h&#039;: 708319460.386547,       &#039;timestamp&#039;: &#039;2022-09-06T14:50:11.000Z&#039;}},     &#039;num_market_pairs&#039;: 619}],   &#039;id&#039;: 24,   &#039;name&#039;: &#039;Kraken&#039;,   &#039;slug&#039;: &#039;kraken&#039;}}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Finally, you need to mind the number calls made in a limited interval and potentially add pauses to the code, so the rate limit is not hit. As suggested by CMC, an [[wikipedia:Exponential_backoff|exponential backoff algorithm]] could be used. While in this tutorial we used the CMC API, fetching data from any other API would be quite similar.&lt;br /&gt;
&lt;br /&gt;
The source code for this article can be found [https://github.com/HumanRupert/algorand_handout here].&lt;/div&gt;</summary>
		<author><name>3126123</name></author>
	</entry>
	<entry>
		<id>https://wiki.fintechlab.unibocconi.eu/index.php?title=AlI_akhtari&amp;diff=313</id>
		<title>AlI akhtari</title>
		<link rel="alternate" type="text/html" href="https://wiki.fintechlab.unibocconi.eu/index.php?title=AlI_akhtari&amp;diff=313"/>
		<updated>2023-02-27T22:54:00Z</updated>

		<summary type="html">&lt;p&gt;3126123: Created page with &amp;quot;My name is Ali Akhtari, and I&amp;#039;m enrolled in the BSc in &amp;#039;&amp;#039;&amp;#039;Mathematical and Computing Sciences for Artificial Intelligence&amp;#039;&amp;#039;&amp;#039; at Bocconi University. I work as a &amp;#039;&amp;#039;&amp;#039;quantitative...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;My name is Ali Akhtari, and I&#039;m enrolled in the BSc in &#039;&#039;&#039;Mathematical and Computing Sciences for Artificial Intelligence&#039;&#039;&#039; at Bocconi University. I work as a &#039;&#039;&#039;quantitative developer at Agron Capital&#039;&#039;&#039;, where I&#039;m mostly focused on the development of a robust and agile infrastructure for algorithmic trading strategies. I&#039;m an incoming engineering summer analyst at &#039;&#039;&#039;Goldman Sachs&#039;&#039;&#039; and a research assistant at &#039;&#039;&#039;Algorand Fintech Lab&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
I&#039;m interested in studying financial markets through the lens of complex systems, networks, and randomness. I enjoy converting real-life problems into mathematical models using algebraic and statistical tools.&lt;br /&gt;
&lt;br /&gt;
You can find me obsessively coding in cafés around Bocconi or reach out to me via my [http://aliakh.me/ personal website].&lt;br /&gt;
&lt;br /&gt;
Sorry if I&#039;m not good with words; I&#039;d rather talk in numbers.&lt;/div&gt;</summary>
		<author><name>3126123</name></author>
	</entry>
	<entry>
		<id>https://wiki.fintechlab.unibocconi.eu/index.php?title=File:Snip6.png&amp;diff=310</id>
		<title>File:Snip6.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.fintechlab.unibocconi.eu/index.php?title=File:Snip6.png&amp;diff=310"/>
		<updated>2023-02-25T10:50:27Z</updated>

		<summary type="html">&lt;p&gt;3126123: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;code-sample-6&lt;/div&gt;</summary>
		<author><name>3126123</name></author>
	</entry>
	<entry>
		<id>https://wiki.fintechlab.unibocconi.eu/index.php?title=File:Snip5.png&amp;diff=309</id>
		<title>File:Snip5.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.fintechlab.unibocconi.eu/index.php?title=File:Snip5.png&amp;diff=309"/>
		<updated>2023-02-25T10:49:43Z</updated>

		<summary type="html">&lt;p&gt;3126123: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;code-sample-5&lt;/div&gt;</summary>
		<author><name>3126123</name></author>
	</entry>
	<entry>
		<id>https://wiki.fintechlab.unibocconi.eu/index.php?title=File:Snip4.png&amp;diff=308</id>
		<title>File:Snip4.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.fintechlab.unibocconi.eu/index.php?title=File:Snip4.png&amp;diff=308"/>
		<updated>2023-02-25T10:48:33Z</updated>

		<summary type="html">&lt;p&gt;3126123: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;code-sample-4&lt;/div&gt;</summary>
		<author><name>3126123</name></author>
	</entry>
	<entry>
		<id>https://wiki.fintechlab.unibocconi.eu/index.php?title=File:Snip3.png&amp;diff=307</id>
		<title>File:Snip3.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.fintechlab.unibocconi.eu/index.php?title=File:Snip3.png&amp;diff=307"/>
		<updated>2023-02-25T10:47:30Z</updated>

		<summary type="html">&lt;p&gt;3126123: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;code-sample-3&lt;/div&gt;</summary>
		<author><name>3126123</name></author>
	</entry>
	<entry>
		<id>https://wiki.fintechlab.unibocconi.eu/index.php?title=File:Snip2.png&amp;diff=306</id>
		<title>File:Snip2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.fintechlab.unibocconi.eu/index.php?title=File:Snip2.png&amp;diff=306"/>
		<updated>2023-02-25T10:47:02Z</updated>

		<summary type="html">&lt;p&gt;3126123: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;code-sample-2&lt;/div&gt;</summary>
		<author><name>3126123</name></author>
	</entry>
	<entry>
		<id>https://wiki.fintechlab.unibocconi.eu/index.php?title=File:Snip1.png&amp;diff=305</id>
		<title>File:Snip1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.fintechlab.unibocconi.eu/index.php?title=File:Snip1.png&amp;diff=305"/>
		<updated>2023-02-25T10:45:55Z</updated>

		<summary type="html">&lt;p&gt;3126123: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;code-sample-1&lt;/div&gt;</summary>
		<author><name>3126123</name></author>
	</entry>
	<entry>
		<id>https://wiki.fintechlab.unibocconi.eu/index.php?title=User:3126123&amp;diff=304</id>
		<title>User:3126123</title>
		<link rel="alternate" type="text/html" href="https://wiki.fintechlab.unibocconi.eu/index.php?title=User:3126123&amp;diff=304"/>
		<updated>2023-02-25T10:13:01Z</updated>

		<summary type="html">&lt;p&gt;3126123: Created page with &amp;quot;= Ali Akhtari = My name is Ali Akhtari, and I&amp;#039;m enrolled in the BSc in &amp;#039;&amp;#039;&amp;#039;Mathematical and Computing Sciences for Artificial Intelligence&amp;#039;&amp;#039;&amp;#039; at Bocconi University. I work as a...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Ali Akhtari =&lt;br /&gt;
My name is Ali Akhtari, and I&#039;m enrolled in the BSc in &#039;&#039;&#039;Mathematical and Computing Sciences for Artificial Intelligence&#039;&#039;&#039; at Bocconi University. I work as a &#039;&#039;&#039;quantitative developer at Agron Capital&#039;&#039;&#039;, where I&#039;m mostly focused on the development of a robust and agile infrastructure for algorithmic trading strategies. I&#039;m an incoming engineering summer analyst at &#039;&#039;&#039;Goldman Sachs&#039;&#039;&#039; and a research assistant at &#039;&#039;&#039;Algorand Fintech Lab&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
I&#039;m interested in studying financial markets through the lens of complex systems, networks, and randomness. I enjoy converting real-life problems into mathematical models using algebraic and statistical tools.&lt;br /&gt;
&lt;br /&gt;
You can find me obsessively coding in cafés around Bocconi or reach out to me via my [http://aliakh.me/ personal website].&lt;br /&gt;
&lt;br /&gt;
Sorry if I&#039;m not good with words; I&#039;d rather talk in numbers.&lt;/div&gt;</summary>
		<author><name>3126123</name></author>
	</entry>
</feed>