This tutorial uses real-time stock trade data, also known as tick data, from Twelve Data. A direct download link is provided below.
To ingest data into the tables that you created, you need to download the dataset and copy the data to your database.
-
Download the
[real_time_stock_data.zip](https://assets.timescale.com/docs/downloads/get-started/real_time_stock_data.zip)real_time_stock_data.zipfile. The file contains two.csvfiles; one with company information, and one with real-time stock trades for the past month. Download: -
In a new terminal window, run this command to unzip the
.csvfiles:unzip real_time_stock_data.zip
-
At the
psqlprompt, use theCOPYcommand to transfer data into your $SERVICE_LONG. If the.csvfiles aren't in your current directory, specify the file paths in these commands:\COPY stocks_real_time from './tutorial_sample_tick.csv' DELIMITER ',' CSV HEADER;
\COPY company from './tutorial_sample_company.csv' DELIMITER ',' CSV HEADER;
Because there are millions of rows of data, the
COPYprocess could take a few minutes depending on your internet connection and local client resources.