Skip to main content
GET
/
market
/
data
/
{instrumentId}
Returns market data for an instrument
curl --request GET \
  --url https://api.pipevest.com/v1/market/data/{instrumentId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Signature: <signature>' \
  --header 'Signature-Input: <signature-input>' \
  --header 'X-Client-Id: <x-client-id>'
import requests

url = "https://api.pipevest.com/v1/market/data/{instrumentId}"

headers = {
    "Signature": "<signature>",
    "Signature-Input": "<signature-input>",
    "X-Client-Id": "<x-client-id>",
    "Authorization": "Bearer <token>"
}

response = requests.get(url, headers=headers)

print(response.text)
const options = {
  method: 'GET',
  headers: {
    Signature: '<signature>',
    'Signature-Input': '<signature-input>',
    'X-Client-Id': '<x-client-id>',
    Authorization: 'Bearer <token>'
  }
};

fetch('https://api.pipevest.com/v1/market/data/{instrumentId}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.pipevest.com/v1/market/data/{instrumentId}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Signature: <signature>",
    "Signature-Input: <signature-input>",
    "X-Client-Id: <x-client-id>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.pipevest.com/v1/market/data/{instrumentId}"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Signature", "<signature>")
	req.Header.Add("Signature-Input", "<signature-input>")
	req.Header.Add("X-Client-Id", "<x-client-id>")
	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.pipevest.com/v1/market/data/{instrumentId}")
  .header("Signature", "<signature>")
  .header("Signature-Input", "<signature-input>")
  .header("X-Client-Id", "<x-client-id>")
  .header("Authorization", "Bearer <token>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.pipevest.com/v1/market/data/{instrumentId}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Signature"] = '<signature>'
request["Signature-Input"] = '<signature-input>'
request["X-Client-Id"] = '<x-client-id>'
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "data": {
    "marketDataId": 123456,
    "instrumentId": 123456,
    "name": "Apple Inc.",
    "currency": "ZK",
    "symbol": "APPL",
    "open": 500,
    "high": 1000,
    "low": 200,
    "close": 200,
    "volume": 200,
    "start": 1234567890,
    "end": 1234567890,
    "timeFrame": "1D",
    "createdAt": 1234567890,
    "updatedAt": 1234567890
  },
  "code": 200,
  "message": "Success"
}
{
  "code": 401,
  "message": "Unauthorized"
}
{
  "code": 404,
  "message": "Not Found"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Signature
string
required

Base64 encoded signed hash of the http message request components.

Learn how signatures work

Example:

"sig1=:OTEyMjY4...A5NTNDMEQ=:"

Signature-Input
string
required

An ordered list of components that make up the signature base. It is used to recompute and verify the Signature

Learn how signatures work

Example:

"sig1=(\"Content-Type\" \"Content-Digest\"...expires=<expires>"

X-Client-Id
string
required

Unique identifier assigned to the client

Example:

"client-id"

Path Parameters

instrumentId
integer
required

Unique instrument identifier

Example:

123456

Query Parameters

start
integer
required

Market data start date as UNIX timestamp

Example:

1234567890

end
integer
required

Market data end date as UNIX timestamp

Example:

1234567890

timeFrame
enum<string>
required

The time frames used to determine instrument market data

Available options:
1D,
5D,
3M,
6M,
YTD,
1Y,
5Y,
ALL
Example:

"1D"

Response

Market data for an instrument

data
object
required
code
string
required

Request response code

Example:

200

message
string
required

Request response message

Example:

"Success"