Samples
note
Fixed forward prices apply only if your organization has access to fixed forward prices. Without it, latestFixedForwardPrices and the fixedForward price symbol of a fuel port profile return a Forbidden error. Contact team@tideform.io to request access.
The JavaScript and Python tabs assume you already have an access token (accessToken in JavaScript, access_token in Python) from the Authentication guide.
All Fixed Forward Prices
- GraphQL
- JavaScript
- Python
query allFixedForwardPrices {
latestFixedForwardPrices {
port {
id
name
countryName
}
fuelGrade {
id
description
}
latestPrices {
publishedDate
price
effectiveDate
relativeDate {
count
unit
}
}
}
}
const response = await fetch("https://api.tideform.io/graphql", {
method: "POST",
headers: {
Authorization: `Bearer ${accessToken}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `query allFixedForwardPrices {
latestFixedForwardPrices {
port { id name countryName }
fuelGrade { id description }
latestPrices { publishedDate price effectiveDate relativeDate { count unit } }
}
}`,
}),
});
const { data } = await response.json();
import requests
response = requests.post(
"https://api.tideform.io/graphql",
json={
"query": """
query allFixedForwardPrices {
latestFixedForwardPrices {
port { id name countryName }
fuelGrade { id description }
latestPrices { publishedDate price effectiveDate relativeDate { count unit } }
}
}
"""
},
headers={"Authorization": f"Bearer {access_token}"},
)
data = response.json()["data"]
Filter By Fuel Grade And Port
- GraphQL
- JavaScript
- Python
query fixedForwardPricesByFuelGradeAndPort {
latestFixedForwardPrices(
input: {
fuelGradeIds: ["mgo", "vlsfo"]
portIds: ["sgsin", "nlrtm", "aefjr"]
}
) {
port {
id
name
countryName
}
fuelGrade {
id
description
}
latestPrices {
publishedDate
price
effectiveDate
relativeDate {
count
unit
}
}
}
}
const response = await fetch("https://api.tideform.io/graphql", {
method: "POST",
headers: {
Authorization: `Bearer ${accessToken}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `query fixedForwardPricesByFuelGradeAndPort {
latestFixedForwardPrices(
input: {
fuelGradeIds: ["mgo", "vlsfo"]
portIds: ["sgsin", "nlrtm", "aefjr"]
}
) {
port { id name countryName }
fuelGrade { id description }
latestPrices { publishedDate price effectiveDate relativeDate { count unit } }
}
}`,
}),
});
const { data } = await response.json();
import requests
response = requests.post(
"https://api.tideform.io/graphql",
json={
"query": """
query fixedForwardPricesByFuelGradeAndPort {
latestFixedForwardPrices(
input: {
fuelGradeIds: ["mgo", "vlsfo"]
portIds: ["sgsin", "nlrtm", "aefjr"]
}
) {
port { id name countryName }
fuelGrade { id description }
latestPrices { publishedDate price effectiveDate relativeDate { count unit } }
}
}
"""
},
headers={"Authorization": f"Bearer {access_token}"},
)
data = response.json()["data"]