[{"data":1,"prerenderedAt":2343},["ShallowReactive",2],{"\u002Fguides\u002Fself-updating-trading-chart-on-your-website-api":3,"\u002Fguides\u002Fself-updating-trading-chart-on-your-website-api-surround":2321,"\u002Fguides\u002Fself-updating-trading-chart-on-your-website-api-langs":2331},{"id":4,"title":5,"authors":6,"badge":12,"body":14,"date":2309,"description":2310,"draft":2311,"extension":2312,"image":2313,"meta":2315,"navigation":853,"path":2316,"seo":2317,"stem":2318,"updated":2319,"__hash__":2320},"posts\u002F3.guides\u002F45.self-updating-trading-chart-on-your-website-api.md","How to Put a Self-Updating Trading Chart on Your Website With a Free API",[7],{"name":8,"to":9,"avatar":10},"ShowMyTrades Team","https:\u002F\u002Fshowmytrades.com",{"src":11},"\u002Ficon-512.png",{"label":13},"Product",{"type":15,"value":16,"toc":2296},"minimark",[17,21,24,29,148,157,161,172,221,224,228,231,294,302,306,335,345,754,807,811,814,1609,1616,1620,1623,2066,2069,2073,2080,2153,2160,2164,2170,2173,2177,2180,2187,2190,2194,2200,2206,2212,2218,2224,2230,2241,2245,2283,2286,2292],[18,19,20],"p",{},"You are building your website, alone or with an AI assistant, and you want your trading results on it: the growth chart of your account, a few numbers under it. And you want them to stay true next week without touching anything.",[18,22,23],{},"The first idea is usually a report: export it from the trading platform, turn it into a chart, upload it. That chart is out of date the day after. This guide shows the other way: your account connected once, and a free API that hands your site the figures, already computed, every time it asks.",[25,26,28],"h2",{"id":27},"three-ways-to-do-it-compared","🧭 Three Ways to Do It, Compared",[30,31,32,50],"table",{},[33,34,35],"thead",{},[36,37,38,41,44,47],"tr",{},[39,40],"th",{},[39,42,43],{},"Export a report and upload it",[39,45,46],{},"Paste a widget",[39,48,49],{},"Read the API",[51,52,53,70,86,102,118,134],"tbody",{},[36,54,55,62,65,68],{},[56,57,58],"td",{},[59,60,61],"strong",{},"Stays up to date",[56,63,64],{},"No: only when you export again",[56,66,67],{},"Yes, on its own",[56,69,67],{},[36,71,72,77,80,83],{},[56,73,74],{},[59,75,76],{},"Design",[56,78,79],{},"Whatever you build",[56,81,82],{},"Ours, with your theme and colours",[56,84,85],{},"Entirely yours",[36,87,88,93,96,99],{},[56,89,90],{},[59,91,92],{},"Code to write",[56,94,95],{},"A reader for the report, the maths, the chart",[56,97,98],{},"None",[56,100,101],{},"One request and your chart",[36,103,104,109,112,115],{},[56,105,106],{},[59,107,108],{},"Growth, drawdown, monthly returns",[56,110,111],{},"Yours to compute",[56,113,114],{},"Ready",[56,116,117],{},"Ready, as JSON",[36,119,120,125,128,131],{},[56,121,122],{},[59,123,124],{},"A visitor can check the numbers",[56,126,127],{},"No: the file is yours",[56,129,130],{},"Yes: the widget links to the account page",[56,132,133],{},"Yes: the line under the chart links to it",[36,135,136,141,144,146],{},[56,137,138],{},[59,139,140],{},"Price",[56,142,143],{},"Free",[56,145,143],{},[56,147,143],{},[18,149,150,151,156],{},"If a ready-made chart is enough, the widget is the shortest road: see ",[152,153,155],"a",{"href":154},"\u002Fguides\u002Fshow-mt4-mt5-results-on-your-website","how to show your MT4 or MT5 results on your website",". The rest of this page is the third column: your own chart, in your own design.",[25,158,160],{"id":159},"step-1-connect-the-account-once","🔌 Step 1: Connect the Account, Once",[18,162,163,167,168,171],{},[152,164,166],{"href":165},"\u002Fsignup","Sign up free",", open ",[59,169,170],{},"Add Account"," in the dashboard and pick your platform. Every connection is read-only: nothing here can open, change or close a trade.",[30,173,174,184],{},[33,175,176],{},[36,177,178,181],{},[39,179,180],{},"Platform",[39,182,183],{},"How it connects",[51,185,186,201,211],{},[36,187,188,193],{},[56,189,190],{},[59,191,192],{},"MetaTrader 4 and 5",[56,194,195,196,200],{},"The read-only ",[152,197,199],{"href":198},"\u002Fglossary\u002Fwhat-is-an-mt4-investor-password","investor password",", or our small Expert Advisor on one chart",[36,202,203,208],{},[56,204,205],{},[59,206,207],{},"cTrader",[56,209,210],{},"One authorisation with your cTrader ID, nothing to install",[36,212,213,218],{},[56,214,215],{},[59,216,217],{},"TradeLocker",[56,219,220],{},"The login your broker or prop firm gave you",[18,222,223],{},"Your history is imported and the statistics are computed for you. From here on they follow the account: this is the part you never have to do again.",[25,225,227],{"id":226},"step-2-publish-the-account-or-create-a-key","🔑 Step 2: Publish the Account, or Create a Key",[18,229,230],{},"The API has two doors, and you choose one.",[30,232,233,245],{},[33,234,235],{},[36,236,237,239,242],{},[39,238],{},[39,240,241],{},"Published account",[39,243,244],{},"Private account",[51,246,247,268,281],{},[36,248,249,254,261],{},[56,250,251],{},[59,252,253],{},"What you do",[56,255,256,257,260],{},"Set the visibility to ",[59,258,259],{},"Published"," in the account settings",[56,262,263,264,267],{},"Create a free ",[59,265,266],{},"Developer API Key"," under Settings in the dashboard",[36,269,270,275,278],{},[56,271,272],{},[59,273,274],{},"API key",[56,276,277],{},"Not needed",[56,279,280],{},"Sent with every request",[36,282,283,288,291],{},[56,284,285],{},[59,286,287],{},"Good for",[56,289,290],{},"A public track record: the account also gets a page a visitor can check",[56,292,293],{},"Numbers you want on your site without a public page",[18,295,296,297,301],{},"A key starts with ",[298,299,300],"code",{},"smt_live_"," and is shown only once: copy it straight away, and keep it on your server.",[25,303,305],{"id":304},"step-3-one-request","📡 Step 3: One Request",[307,308,313],"pre",{"className":309,"code":310,"language":311,"meta":312,"style":312},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","curl \"https:\u002F\u002Fshowmytrades.com\u002Fapi\u002Fv1\u002Faccounts\u002FYOUR-ACCOUNT-SLUG?include=equity_curve\"\n","bash","",[298,314,315],{"__ignoreMap":312},[316,317,320,324,328,332],"span",{"class":318,"line":319},"line",1,[316,321,323],{"class":322},"sBMFI","curl",[316,325,327],{"class":326},"sMK4o"," \"",[316,329,331],{"class":330},"sfazB","https:\u002F\u002Fshowmytrades.com\u002Fapi\u002Fv1\u002Faccounts\u002FYOUR-ACCOUNT-SLUG?include=equity_curve",[316,333,334],{"class":326},"\"\n",[18,336,337,340,341,344],{},[298,338,339],{},"YOUR-ACCOUNT-SLUG"," is the last part of the address of your account page, ",[298,342,343],{},"https:\u002F\u002Fshowmytrades.com\u002Faccount\u002FYOUR-ACCOUNT-SLUG",". The answer looks like this, shortened:",[307,346,350],{"className":347,"code":348,"language":349,"meta":312,"style":312},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"name\": \"My EURUSD account\",\n  \"platform\": \"MT5\",\n  \"currency\": \"USD\",\n  \"balance\": 20980.4,\n  \"equity\": 20911.15,\n  \"performance\": { \"twr_percent\": 109.88, \"max_drawdown_percent\": 7.86 },\n  \"equity_curve\": {\n    \"daily_performance\": [\n      { \"date\": \"2025-11-10\", \"twr_percent\": 0.99, \"cumulative_balance\": 20197.7, \"drawdown\": 0 },\n      { \"date\": \"2025-11-11\", \"twr_percent\": 1.42, \"cumulative_balance\": 20283.1, \"drawdown\": 0 }\n    ]\n  },\n  \"attribution\": {\n    \"required\": true,\n    \"text\": \"Data from ShowMyTrades\",\n    \"url\": \"https:\u002F\u002Fshowmytrades.com\u002Faccount\u002FYOUR-ACCOUNT-SLUG\"\n  }\n}\n","json",[298,351,352,357,383,404,425,443,460,505,520,536,601,662,668,674,688,703,724,742,748],{"__ignoreMap":312},[316,353,354],{"class":318,"line":319},[316,355,356],{"class":326},"{\n",[316,358,360,363,367,370,373,375,378,380],{"class":318,"line":359},2,[316,361,362],{"class":326},"  \"",[316,364,366],{"class":365},"spNyl","name",[316,368,369],{"class":326},"\"",[316,371,372],{"class":326},":",[316,374,327],{"class":326},[316,376,377],{"class":330},"My EURUSD account",[316,379,369],{"class":326},[316,381,382],{"class":326},",\n",[316,384,386,388,391,393,395,397,400,402],{"class":318,"line":385},3,[316,387,362],{"class":326},[316,389,390],{"class":365},"platform",[316,392,369],{"class":326},[316,394,372],{"class":326},[316,396,327],{"class":326},[316,398,399],{"class":330},"MT5",[316,401,369],{"class":326},[316,403,382],{"class":326},[316,405,407,409,412,414,416,418,421,423],{"class":318,"line":406},4,[316,408,362],{"class":326},[316,410,411],{"class":365},"currency",[316,413,369],{"class":326},[316,415,372],{"class":326},[316,417,327],{"class":326},[316,419,420],{"class":330},"USD",[316,422,369],{"class":326},[316,424,382],{"class":326},[316,426,428,430,433,435,437,441],{"class":318,"line":427},5,[316,429,362],{"class":326},[316,431,432],{"class":365},"balance",[316,434,369],{"class":326},[316,436,372],{"class":326},[316,438,440],{"class":439},"sbssI"," 20980.4",[316,442,382],{"class":326},[316,444,446,448,451,453,455,458],{"class":318,"line":445},6,[316,447,362],{"class":326},[316,449,450],{"class":365},"equity",[316,452,369],{"class":326},[316,454,372],{"class":326},[316,456,457],{"class":439}," 20911.15",[316,459,382],{"class":326},[316,461,463,465,468,470,472,475,477,480,482,484,487,490,492,495,497,499,502],{"class":318,"line":462},7,[316,464,362],{"class":326},[316,466,467],{"class":365},"performance",[316,469,369],{"class":326},[316,471,372],{"class":326},[316,473,474],{"class":326}," {",[316,476,327],{"class":326},[316,478,479],{"class":322},"twr_percent",[316,481,369],{"class":326},[316,483,372],{"class":326},[316,485,486],{"class":439}," 109.88",[316,488,489],{"class":326},",",[316,491,327],{"class":326},[316,493,494],{"class":322},"max_drawdown_percent",[316,496,369],{"class":326},[316,498,372],{"class":326},[316,500,501],{"class":439}," 7.86",[316,503,504],{"class":326}," },\n",[316,506,508,510,513,515,517],{"class":318,"line":507},8,[316,509,362],{"class":326},[316,511,512],{"class":365},"equity_curve",[316,514,369],{"class":326},[316,516,372],{"class":326},[316,518,519],{"class":326}," {\n",[316,521,523,526,529,531,533],{"class":318,"line":522},9,[316,524,525],{"class":326},"    \"",[316,527,528],{"class":322},"daily_performance",[316,530,369],{"class":326},[316,532,372],{"class":326},[316,534,535],{"class":326}," [\n",[316,537,539,542,544,547,549,551,553,556,558,560,562,564,566,568,571,573,575,578,580,582,585,587,589,592,594,596,599],{"class":318,"line":538},10,[316,540,541],{"class":326},"      {",[316,543,327],{"class":326},[316,545,546],{"class":439},"date",[316,548,369],{"class":326},[316,550,372],{"class":326},[316,552,327],{"class":326},[316,554,555],{"class":330},"2025-11-10",[316,557,369],{"class":326},[316,559,489],{"class":326},[316,561,327],{"class":326},[316,563,479],{"class":439},[316,565,369],{"class":326},[316,567,372],{"class":326},[316,569,570],{"class":439}," 0.99",[316,572,489],{"class":326},[316,574,327],{"class":326},[316,576,577],{"class":439},"cumulative_balance",[316,579,369],{"class":326},[316,581,372],{"class":326},[316,583,584],{"class":439}," 20197.7",[316,586,489],{"class":326},[316,588,327],{"class":326},[316,590,591],{"class":439},"drawdown",[316,593,369],{"class":326},[316,595,372],{"class":326},[316,597,598],{"class":439}," 0",[316,600,504],{"class":326},[316,602,604,606,608,610,612,614,616,619,621,623,625,627,629,631,634,636,638,640,642,644,647,649,651,653,655,657,659],{"class":318,"line":603},11,[316,605,541],{"class":326},[316,607,327],{"class":326},[316,609,546],{"class":439},[316,611,369],{"class":326},[316,613,372],{"class":326},[316,615,327],{"class":326},[316,617,618],{"class":330},"2025-11-11",[316,620,369],{"class":326},[316,622,489],{"class":326},[316,624,327],{"class":326},[316,626,479],{"class":439},[316,628,369],{"class":326},[316,630,372],{"class":326},[316,632,633],{"class":439}," 1.42",[316,635,489],{"class":326},[316,637,327],{"class":326},[316,639,577],{"class":439},[316,641,369],{"class":326},[316,643,372],{"class":326},[316,645,646],{"class":439}," 20283.1",[316,648,489],{"class":326},[316,650,327],{"class":326},[316,652,591],{"class":439},[316,654,369],{"class":326},[316,656,372],{"class":326},[316,658,598],{"class":439},[316,660,661],{"class":326}," }\n",[316,663,665],{"class":318,"line":664},12,[316,666,667],{"class":326},"    ]\n",[316,669,671],{"class":318,"line":670},13,[316,672,673],{"class":326},"  },\n",[316,675,677,679,682,684,686],{"class":318,"line":676},14,[316,678,362],{"class":326},[316,680,681],{"class":365},"attribution",[316,683,369],{"class":326},[316,685,372],{"class":326},[316,687,519],{"class":326},[316,689,691,693,696,698,700],{"class":318,"line":690},15,[316,692,525],{"class":326},[316,694,695],{"class":322},"required",[316,697,369],{"class":326},[316,699,372],{"class":326},[316,701,702],{"class":326}," true,\n",[316,704,706,708,711,713,715,717,720,722],{"class":318,"line":705},16,[316,707,525],{"class":326},[316,709,710],{"class":322},"text",[316,712,369],{"class":326},[316,714,372],{"class":326},[316,716,327],{"class":326},[316,718,719],{"class":330},"Data from ShowMyTrades",[316,721,369],{"class":326},[316,723,382],{"class":326},[316,725,727,729,732,734,736,738,740],{"class":318,"line":726},17,[316,728,525],{"class":326},[316,730,731],{"class":322},"url",[316,733,369],{"class":326},[316,735,372],{"class":326},[316,737,327],{"class":326},[316,739,343],{"class":330},[316,741,334],{"class":326},[316,743,745],{"class":318,"line":744},18,[316,746,747],{"class":326},"  }\n",[316,749,751],{"class":318,"line":750},19,[316,752,753],{"class":326},"}\n",[30,755,756,766],{},[33,757,758],{},[36,759,760,763],{},[39,761,762],{},"Field",[39,764,765],{},"What it is",[51,767,768,778,788,798],{},[36,769,770,775],{},[56,771,772],{},[298,773,774],{},"performance.twr_percent",[56,776,777],{},"The growth of the account in percent, with deposits and withdrawals kept out of the result",[36,779,780,785],{},[56,781,782],{},[298,783,784],{},"performance.max_drawdown_percent",[56,786,787],{},"The deepest fall from a peak, in percent",[36,789,790,795],{},[56,791,792],{},[298,793,794],{},"equity_curve.daily_performance",[56,796,797],{},"One row per trading day: the growth so far, the balance, the equity, the drawdown",[36,799,800,804],{},[56,801,802],{},[298,803,681],{},[56,805,806],{},"The line to show next to the data, with its link",[25,808,810],{"id":809},"️-step-4-a-small-function-on-your-server","🖥️ Step 4: A Small Function on Your Server",[18,812,813],{},"The request goes from your server, not from the visitor's browser: a key must stay secret, and browsers cannot call this API from another site anyway. The function asks the API every five minutes and keeps the answer, so your page stays fast.",[307,815,820],{"className":816,"code":817,"filename":818,"language":819,"meta":312,"style":312},"language-js shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { createServer } from 'node:http'\n\nconst SLUG = 'YOUR-ACCOUNT-SLUG'\nconst KEY = process.env.SHOWMYTRADES_KEY \u002F\u002F only for a private account\nlet cache = { at: 0, body: null }\n\nasync function tradingResults() {\n  if (Date.now() - cache.at \u003C 5 * 60 * 1000) return cache.body\n\n  const response = await fetch(\n    `https:\u002F\u002Fshowmytrades.com\u002Fapi\u002Fv1\u002Faccounts\u002F${SLUG}?include=equity_curve`,\n    { headers: KEY ? { Authorization: `Bearer ${KEY}` } : {} }\n  )\n  if (!response.ok) return cache.body \u002F\u002F keep showing the last good answer\n\n  const account = await response.json()\n  cache = {\n    at: Date.now(),\n    body: JSON.stringify({\n      name: account.name,\n      growth: account.performance.twr_percent,\n      maxDrawdown: account.performance.max_drawdown_percent,\n      days: account.equity_curve.daily_performance.map(day => ({\n        date: day.date,\n        growth: day.twr_percent,\n        drawdown: day.drawdown\n      })),\n      attribution: account.attribution\n    })\n  }\n  return cache.body\n}\n\ncreateServer(async (request, response) => {\n  if (request.url !== '\u002Ftrading-results.json') {\n    response.writeHead(404).end()\n    return\n  }\n  const body = await tradingResults()\n  response.writeHead(body ? 200 : 502, { 'Content-Type': 'application\u002Fjson' }).end(body ?? '{}')\n}).listen(3000)\n","server.js","js",[298,821,822,849,855,872,899,931,935,952,1012,1016,1036,1061,1108,1113,1144,1148,1168,1177,1195,1215,1231,1251,1271,1307,1324,1340,1355,1366,1381,1390,1395,1407,1412,1417,1443,1471,1496,1502,1507,1522,1590],{"__ignoreMap":312},[316,823,824,828,830,834,837,840,843,846],{"class":318,"line":319},[316,825,827],{"class":826},"s7zQu","import",[316,829,474],{"class":326},[316,831,833],{"class":832},"sTEyZ"," createServer",[316,835,836],{"class":326}," }",[316,838,839],{"class":826}," from",[316,841,842],{"class":326}," '",[316,844,845],{"class":330},"node:http",[316,847,848],{"class":326},"'\n",[316,850,851],{"class":318,"line":359},[316,852,854],{"emptyLinePlaceholder":853},true,"\n",[316,856,857,860,863,866,868,870],{"class":318,"line":385},[316,858,859],{"class":365},"const",[316,861,862],{"class":832}," SLUG ",[316,864,865],{"class":326},"=",[316,867,842],{"class":326},[316,869,339],{"class":330},[316,871,848],{"class":326},[316,873,874,876,879,881,884,887,890,892,895],{"class":318,"line":406},[316,875,859],{"class":365},[316,877,878],{"class":832}," KEY ",[316,880,865],{"class":326},[316,882,883],{"class":832}," process",[316,885,886],{"class":326},".",[316,888,889],{"class":832},"env",[316,891,886],{"class":326},[316,893,894],{"class":832},"SHOWMYTRADES_KEY ",[316,896,898],{"class":897},"sHwdD","\u002F\u002F only for a private account\n",[316,900,901,904,907,909,911,915,917,919,921,924,926,929],{"class":318,"line":427},[316,902,903],{"class":365},"let",[316,905,906],{"class":832}," cache ",[316,908,865],{"class":326},[316,910,474],{"class":326},[316,912,914],{"class":913},"swJcz"," at",[316,916,372],{"class":326},[316,918,598],{"class":439},[316,920,489],{"class":326},[316,922,923],{"class":913}," body",[316,925,372],{"class":326},[316,927,928],{"class":326}," null",[316,930,661],{"class":326},[316,932,933],{"class":318,"line":445},[316,934,854],{"emptyLinePlaceholder":853},[316,936,937,940,943,947,950],{"class":318,"line":462},[316,938,939],{"class":365},"async",[316,941,942],{"class":365}," function",[316,944,946],{"class":945},"s2Zo4"," tradingResults",[316,948,949],{"class":326},"()",[316,951,519],{"class":326},[316,953,954,957,960,963,965,968,971,974,977,979,982,985,988,991,994,996,999,1002,1005,1007,1009],{"class":318,"line":507},[316,955,956],{"class":826},"  if",[316,958,959],{"class":913}," (",[316,961,962],{"class":832},"Date",[316,964,886],{"class":326},[316,966,967],{"class":945},"now",[316,969,970],{"class":913},"() ",[316,972,973],{"class":326},"-",[316,975,976],{"class":832}," cache",[316,978,886],{"class":326},[316,980,981],{"class":832},"at",[316,983,984],{"class":326}," \u003C",[316,986,987],{"class":439}," 5",[316,989,990],{"class":326}," *",[316,992,993],{"class":439}," 60",[316,995,990],{"class":326},[316,997,998],{"class":439}," 1000",[316,1000,1001],{"class":913},") ",[316,1003,1004],{"class":826},"return",[316,1006,976],{"class":832},[316,1008,886],{"class":326},[316,1010,1011],{"class":832},"body\n",[316,1013,1014],{"class":318,"line":522},[316,1015,854],{"emptyLinePlaceholder":853},[316,1017,1018,1021,1024,1027,1030,1033],{"class":318,"line":538},[316,1019,1020],{"class":365},"  const",[316,1022,1023],{"class":832}," response",[316,1025,1026],{"class":326}," =",[316,1028,1029],{"class":826}," await",[316,1031,1032],{"class":945}," fetch",[316,1034,1035],{"class":913},"(\n",[316,1037,1038,1041,1044,1047,1050,1053,1056,1059],{"class":318,"line":603},[316,1039,1040],{"class":326},"    `",[316,1042,1043],{"class":330},"https:\u002F\u002Fshowmytrades.com\u002Fapi\u002Fv1\u002Faccounts\u002F",[316,1045,1046],{"class":326},"${",[316,1048,1049],{"class":832},"SLUG",[316,1051,1052],{"class":326},"}",[316,1054,1055],{"class":330},"?include=equity_curve",[316,1057,1058],{"class":326},"`",[316,1060,382],{"class":326},[316,1062,1063,1066,1069,1071,1074,1077,1079,1082,1084,1087,1090,1092,1095,1098,1100,1103,1106],{"class":318,"line":664},[316,1064,1065],{"class":326},"    {",[316,1067,1068],{"class":913}," headers",[316,1070,372],{"class":326},[316,1072,1073],{"class":832}," KEY",[316,1075,1076],{"class":326}," ?",[316,1078,474],{"class":326},[316,1080,1081],{"class":913}," Authorization",[316,1083,372],{"class":326},[316,1085,1086],{"class":326}," `",[316,1088,1089],{"class":330},"Bearer ",[316,1091,1046],{"class":326},[316,1093,1094],{"class":832},"KEY",[316,1096,1097],{"class":326},"}`",[316,1099,836],{"class":326},[316,1101,1102],{"class":326}," :",[316,1104,1105],{"class":326}," {}",[316,1107,661],{"class":326},[316,1109,1110],{"class":318,"line":670},[316,1111,1112],{"class":913},"  )\n",[316,1114,1115,1117,1119,1122,1125,1127,1130,1132,1134,1136,1138,1141],{"class":318,"line":676},[316,1116,956],{"class":826},[316,1118,959],{"class":913},[316,1120,1121],{"class":326},"!",[316,1123,1124],{"class":832},"response",[316,1126,886],{"class":326},[316,1128,1129],{"class":832},"ok",[316,1131,1001],{"class":913},[316,1133,1004],{"class":826},[316,1135,976],{"class":832},[316,1137,886],{"class":326},[316,1139,1140],{"class":832},"body",[316,1142,1143],{"class":897}," \u002F\u002F keep showing the last good answer\n",[316,1145,1146],{"class":318,"line":690},[316,1147,854],{"emptyLinePlaceholder":853},[316,1149,1150,1152,1155,1157,1159,1161,1163,1165],{"class":318,"line":705},[316,1151,1020],{"class":365},[316,1153,1154],{"class":832}," account",[316,1156,1026],{"class":326},[316,1158,1029],{"class":826},[316,1160,1023],{"class":832},[316,1162,886],{"class":326},[316,1164,349],{"class":945},[316,1166,1167],{"class":913},"()\n",[316,1169,1170,1173,1175],{"class":318,"line":726},[316,1171,1172],{"class":832},"  cache",[316,1174,1026],{"class":326},[316,1176,519],{"class":326},[316,1178,1179,1182,1184,1187,1189,1191,1193],{"class":318,"line":744},[316,1180,1181],{"class":913},"    at",[316,1183,372],{"class":326},[316,1185,1186],{"class":832}," Date",[316,1188,886],{"class":326},[316,1190,967],{"class":945},[316,1192,949],{"class":913},[316,1194,382],{"class":326},[316,1196,1197,1200,1202,1205,1207,1210,1213],{"class":318,"line":750},[316,1198,1199],{"class":913},"    body",[316,1201,372],{"class":326},[316,1203,1204],{"class":832}," JSON",[316,1206,886],{"class":326},[316,1208,1209],{"class":945},"stringify",[316,1211,1212],{"class":913},"(",[316,1214,356],{"class":326},[316,1216,1218,1221,1223,1225,1227,1229],{"class":318,"line":1217},20,[316,1219,1220],{"class":913},"      name",[316,1222,372],{"class":326},[316,1224,1154],{"class":832},[316,1226,886],{"class":326},[316,1228,366],{"class":832},[316,1230,382],{"class":326},[316,1232,1234,1237,1239,1241,1243,1245,1247,1249],{"class":318,"line":1233},21,[316,1235,1236],{"class":913},"      growth",[316,1238,372],{"class":326},[316,1240,1154],{"class":832},[316,1242,886],{"class":326},[316,1244,467],{"class":832},[316,1246,886],{"class":326},[316,1248,479],{"class":832},[316,1250,382],{"class":326},[316,1252,1254,1257,1259,1261,1263,1265,1267,1269],{"class":318,"line":1253},22,[316,1255,1256],{"class":913},"      maxDrawdown",[316,1258,372],{"class":326},[316,1260,1154],{"class":832},[316,1262,886],{"class":326},[316,1264,467],{"class":832},[316,1266,886],{"class":326},[316,1268,494],{"class":832},[316,1270,382],{"class":326},[316,1272,1274,1277,1279,1281,1283,1285,1287,1289,1291,1294,1296,1300,1303,1305],{"class":318,"line":1273},23,[316,1275,1276],{"class":913},"      days",[316,1278,372],{"class":326},[316,1280,1154],{"class":832},[316,1282,886],{"class":326},[316,1284,512],{"class":832},[316,1286,886],{"class":326},[316,1288,528],{"class":832},[316,1290,886],{"class":326},[316,1292,1293],{"class":945},"map",[316,1295,1212],{"class":913},[316,1297,1299],{"class":1298},"sHdIc","day",[316,1301,1302],{"class":365}," =>",[316,1304,959],{"class":913},[316,1306,356],{"class":326},[316,1308,1310,1313,1315,1318,1320,1322],{"class":318,"line":1309},24,[316,1311,1312],{"class":913},"        date",[316,1314,372],{"class":326},[316,1316,1317],{"class":832}," day",[316,1319,886],{"class":326},[316,1321,546],{"class":832},[316,1323,382],{"class":326},[316,1325,1327,1330,1332,1334,1336,1338],{"class":318,"line":1326},25,[316,1328,1329],{"class":913},"        growth",[316,1331,372],{"class":326},[316,1333,1317],{"class":832},[316,1335,886],{"class":326},[316,1337,479],{"class":832},[316,1339,382],{"class":326},[316,1341,1343,1346,1348,1350,1352],{"class":318,"line":1342},26,[316,1344,1345],{"class":913},"        drawdown",[316,1347,372],{"class":326},[316,1349,1317],{"class":832},[316,1351,886],{"class":326},[316,1353,1354],{"class":832},"drawdown\n",[316,1356,1358,1361,1364],{"class":318,"line":1357},27,[316,1359,1360],{"class":326},"      }",[316,1362,1363],{"class":913},"))",[316,1365,382],{"class":326},[316,1367,1369,1372,1374,1376,1378],{"class":318,"line":1368},28,[316,1370,1371],{"class":913},"      attribution",[316,1373,372],{"class":326},[316,1375,1154],{"class":832},[316,1377,886],{"class":326},[316,1379,1380],{"class":832},"attribution\n",[316,1382,1384,1387],{"class":318,"line":1383},29,[316,1385,1386],{"class":326},"    }",[316,1388,1389],{"class":913},")\n",[316,1391,1393],{"class":318,"line":1392},30,[316,1394,747],{"class":326},[316,1396,1398,1401,1403,1405],{"class":318,"line":1397},31,[316,1399,1400],{"class":826},"  return",[316,1402,976],{"class":832},[316,1404,886],{"class":326},[316,1406,1011],{"class":832},[316,1408,1410],{"class":318,"line":1409},32,[316,1411,753],{"class":326},[316,1413,1415],{"class":318,"line":1414},33,[316,1416,854],{"emptyLinePlaceholder":853},[316,1418,1420,1423,1425,1427,1429,1432,1434,1436,1439,1441],{"class":318,"line":1419},34,[316,1421,1422],{"class":945},"createServer",[316,1424,1212],{"class":832},[316,1426,939],{"class":365},[316,1428,959],{"class":326},[316,1430,1431],{"class":1298},"request",[316,1433,489],{"class":326},[316,1435,1023],{"class":1298},[316,1437,1438],{"class":326},")",[316,1440,1302],{"class":365},[316,1442,519],{"class":326},[316,1444,1446,1448,1450,1452,1454,1456,1459,1461,1464,1467,1469],{"class":318,"line":1445},35,[316,1447,956],{"class":826},[316,1449,959],{"class":913},[316,1451,1431],{"class":832},[316,1453,886],{"class":326},[316,1455,731],{"class":832},[316,1457,1458],{"class":326}," !==",[316,1460,842],{"class":326},[316,1462,1463],{"class":330},"\u002Ftrading-results.json",[316,1465,1466],{"class":326},"'",[316,1468,1001],{"class":913},[316,1470,356],{"class":326},[316,1472,1474,1477,1479,1482,1484,1487,1489,1491,1494],{"class":318,"line":1473},36,[316,1475,1476],{"class":832},"    response",[316,1478,886],{"class":326},[316,1480,1481],{"class":945},"writeHead",[316,1483,1212],{"class":913},[316,1485,1486],{"class":439},"404",[316,1488,1438],{"class":913},[316,1490,886],{"class":326},[316,1492,1493],{"class":945},"end",[316,1495,1167],{"class":913},[316,1497,1499],{"class":318,"line":1498},37,[316,1500,1501],{"class":826},"    return\n",[316,1503,1505],{"class":318,"line":1504},38,[316,1506,747],{"class":326},[316,1508,1510,1512,1514,1516,1518,1520],{"class":318,"line":1509},39,[316,1511,1020],{"class":365},[316,1513,923],{"class":832},[316,1515,1026],{"class":326},[316,1517,1029],{"class":826},[316,1519,946],{"class":945},[316,1521,1167],{"class":913},[316,1523,1525,1528,1530,1532,1534,1536,1538,1541,1543,1546,1548,1550,1552,1555,1557,1559,1561,1564,1566,1568,1570,1572,1574,1576,1578,1581,1583,1586,1588],{"class":318,"line":1524},40,[316,1526,1527],{"class":832},"  response",[316,1529,886],{"class":326},[316,1531,1481],{"class":945},[316,1533,1212],{"class":913},[316,1535,1140],{"class":832},[316,1537,1076],{"class":326},[316,1539,1540],{"class":439}," 200",[316,1542,1102],{"class":326},[316,1544,1545],{"class":439}," 502",[316,1547,489],{"class":326},[316,1549,474],{"class":326},[316,1551,842],{"class":326},[316,1553,1554],{"class":913},"Content-Type",[316,1556,1466],{"class":326},[316,1558,372],{"class":326},[316,1560,842],{"class":326},[316,1562,1563],{"class":330},"application\u002Fjson",[316,1565,1466],{"class":326},[316,1567,836],{"class":326},[316,1569,1438],{"class":913},[316,1571,886],{"class":326},[316,1573,1493],{"class":945},[316,1575,1212],{"class":913},[316,1577,1140],{"class":832},[316,1579,1580],{"class":326}," ??",[316,1582,842],{"class":326},[316,1584,1585],{"class":330},"{}",[316,1587,1466],{"class":326},[316,1589,1389],{"class":913},[316,1591,1593,1595,1597,1599,1602,1604,1607],{"class":318,"line":1592},41,[316,1594,1052],{"class":326},[316,1596,1438],{"class":832},[316,1598,886],{"class":326},[316,1600,1601],{"class":945},"listen",[316,1603,1212],{"class":832},[316,1605,1606],{"class":439},"3000",[316,1608,1389],{"class":832},[18,1610,1611,1612,886],{},"This is plain Node.js, with nothing to install. The same few lines work in any language that can make an HTTPS request: for WordPress there is a ready ",[152,1613,1615],{"href":1614},"\u002Fguides\u002Fadd-trading-results-to-wordpress","shortcode in PHP",[25,1617,1619],{"id":1618},"step-5-draw-the-chart","🎨 Step 5: Draw the Chart",[18,1621,1622],{},"Your page reads the small file your server prepared and draws it. This example uses Chart.js. Any charting library does the same job.",[307,1624,1629],{"className":1625,"code":1626,"filename":1627,"language":1628,"meta":312,"style":312},"language-html shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u003Ccanvas id=\"growth\">\u003C\u002Fcanvas>\n\u003Cp id=\"source\">\u003C\u002Fp>\n\n\u003Cscript src=\"https:\u002F\u002Fcdn.jsdelivr.net\u002Fnpm\u002Fchart.js\">\u003C\u002Fscript>\n\u003Cscript>\n  fetch('\u002Ftrading-results.json')\n    .then(response => response.json())\n    .then((data) => {\n      new Chart(document.getElementById('growth'), {\n        type: 'line',\n        data: {\n          labels: data.days.map(day => day.date),\n          datasets: [{ label: 'Growth %', data: data.days.map(day => day.growth) }]\n        }\n      })\n\n      \u002F\u002F The line under the chart: text and link come ready in the answer.\n      const link = document.createElement('a')\n      link.href = data.attribution.url\n      link.textContent = data.attribution.text\n      document.getElementById('source').append(link)\n    })\n\u003C\u002Fscript>\n","index.html","html",[298,1630,1631,1659,1682,1686,1711,1719,1734,1757,1776,1808,1823,1832,1867,1927,1932,1938,1942,1947,1975,1998,2020,2051,2057],{"__ignoreMap":312},[316,1632,1633,1636,1639,1642,1644,1646,1649,1651,1654,1656],{"class":318,"line":319},[316,1634,1635],{"class":326},"\u003C",[316,1637,1638],{"class":913},"canvas",[316,1640,1641],{"class":365}," id",[316,1643,865],{"class":326},[316,1645,369],{"class":326},[316,1647,1648],{"class":330},"growth",[316,1650,369],{"class":326},[316,1652,1653],{"class":326},">\u003C\u002F",[316,1655,1638],{"class":913},[316,1657,1658],{"class":326},">\n",[316,1660,1661,1663,1665,1667,1669,1671,1674,1676,1678,1680],{"class":318,"line":359},[316,1662,1635],{"class":326},[316,1664,18],{"class":913},[316,1666,1641],{"class":365},[316,1668,865],{"class":326},[316,1670,369],{"class":326},[316,1672,1673],{"class":330},"source",[316,1675,369],{"class":326},[316,1677,1653],{"class":326},[316,1679,18],{"class":913},[316,1681,1658],{"class":326},[316,1683,1684],{"class":318,"line":385},[316,1685,854],{"emptyLinePlaceholder":853},[316,1687,1688,1690,1693,1696,1698,1700,1703,1705,1707,1709],{"class":318,"line":406},[316,1689,1635],{"class":326},[316,1691,1692],{"class":913},"script",[316,1694,1695],{"class":365}," src",[316,1697,865],{"class":326},[316,1699,369],{"class":326},[316,1701,1702],{"class":330},"https:\u002F\u002Fcdn.jsdelivr.net\u002Fnpm\u002Fchart.js",[316,1704,369],{"class":326},[316,1706,1653],{"class":326},[316,1708,1692],{"class":913},[316,1710,1658],{"class":326},[316,1712,1713,1715,1717],{"class":318,"line":427},[316,1714,1635],{"class":326},[316,1716,1692],{"class":913},[316,1718,1658],{"class":326},[316,1720,1721,1724,1726,1728,1730,1732],{"class":318,"line":445},[316,1722,1723],{"class":945},"  fetch",[316,1725,1212],{"class":832},[316,1727,1466],{"class":326},[316,1729,1463],{"class":330},[316,1731,1466],{"class":326},[316,1733,1389],{"class":832},[316,1735,1736,1739,1742,1744,1746,1748,1750,1752,1754],{"class":318,"line":462},[316,1737,1738],{"class":326},"    .",[316,1740,1741],{"class":945},"then",[316,1743,1212],{"class":832},[316,1745,1124],{"class":1298},[316,1747,1302],{"class":365},[316,1749,1023],{"class":832},[316,1751,886],{"class":326},[316,1753,349],{"class":945},[316,1755,1756],{"class":832},"())\n",[316,1758,1759,1761,1763,1765,1767,1770,1772,1774],{"class":318,"line":507},[316,1760,1738],{"class":326},[316,1762,1741],{"class":945},[316,1764,1212],{"class":832},[316,1766,1212],{"class":326},[316,1768,1769],{"class":1298},"data",[316,1771,1438],{"class":326},[316,1773,1302],{"class":365},[316,1775,519],{"class":326},[316,1777,1778,1781,1784,1786,1789,1791,1794,1796,1798,1800,1802,1804,1806],{"class":318,"line":522},[316,1779,1780],{"class":326},"      new",[316,1782,1783],{"class":945}," Chart",[316,1785,1212],{"class":913},[316,1787,1788],{"class":832},"document",[316,1790,886],{"class":326},[316,1792,1793],{"class":945},"getElementById",[316,1795,1212],{"class":913},[316,1797,1466],{"class":326},[316,1799,1648],{"class":330},[316,1801,1466],{"class":326},[316,1803,1438],{"class":913},[316,1805,489],{"class":326},[316,1807,519],{"class":326},[316,1809,1810,1813,1815,1817,1819,1821],{"class":318,"line":538},[316,1811,1812],{"class":913},"        type",[316,1814,372],{"class":326},[316,1816,842],{"class":326},[316,1818,318],{"class":330},[316,1820,1466],{"class":326},[316,1822,382],{"class":326},[316,1824,1825,1828,1830],{"class":318,"line":603},[316,1826,1827],{"class":913},"        data",[316,1829,372],{"class":326},[316,1831,519],{"class":326},[316,1833,1834,1837,1839,1842,1844,1847,1849,1851,1853,1855,1857,1859,1861,1863,1865],{"class":318,"line":664},[316,1835,1836],{"class":913},"          labels",[316,1838,372],{"class":326},[316,1840,1841],{"class":832}," data",[316,1843,886],{"class":326},[316,1845,1846],{"class":832},"days",[316,1848,886],{"class":326},[316,1850,1293],{"class":945},[316,1852,1212],{"class":913},[316,1854,1299],{"class":1298},[316,1856,1302],{"class":365},[316,1858,1317],{"class":832},[316,1860,886],{"class":326},[316,1862,546],{"class":832},[316,1864,1438],{"class":913},[316,1866,382],{"class":326},[316,1868,1869,1872,1874,1877,1880,1883,1885,1887,1890,1892,1894,1896,1898,1900,1902,1904,1906,1908,1910,1912,1914,1916,1918,1920,1922,1924],{"class":318,"line":670},[316,1870,1871],{"class":913},"          datasets",[316,1873,372],{"class":326},[316,1875,1876],{"class":913}," [",[316,1878,1879],{"class":326},"{",[316,1881,1882],{"class":913}," label",[316,1884,372],{"class":326},[316,1886,842],{"class":326},[316,1888,1889],{"class":330},"Growth %",[316,1891,1466],{"class":326},[316,1893,489],{"class":326},[316,1895,1841],{"class":913},[316,1897,372],{"class":326},[316,1899,1841],{"class":832},[316,1901,886],{"class":326},[316,1903,1846],{"class":832},[316,1905,886],{"class":326},[316,1907,1293],{"class":945},[316,1909,1212],{"class":913},[316,1911,1299],{"class":1298},[316,1913,1302],{"class":365},[316,1915,1317],{"class":832},[316,1917,886],{"class":326},[316,1919,1648],{"class":832},[316,1921,1001],{"class":913},[316,1923,1052],{"class":326},[316,1925,1926],{"class":913},"]\n",[316,1928,1929],{"class":318,"line":676},[316,1930,1931],{"class":326},"        }\n",[316,1933,1934,1936],{"class":318,"line":690},[316,1935,1360],{"class":326},[316,1937,1389],{"class":913},[316,1939,1940],{"class":318,"line":705},[316,1941,854],{"emptyLinePlaceholder":853},[316,1943,1944],{"class":318,"line":726},[316,1945,1946],{"class":897},"      \u002F\u002F The line under the chart: text and link come ready in the answer.\n",[316,1948,1949,1952,1955,1957,1960,1962,1965,1967,1969,1971,1973],{"class":318,"line":744},[316,1950,1951],{"class":365},"      const",[316,1953,1954],{"class":832}," link",[316,1956,1026],{"class":326},[316,1958,1959],{"class":832}," document",[316,1961,886],{"class":326},[316,1963,1964],{"class":945},"createElement",[316,1966,1212],{"class":913},[316,1968,1466],{"class":326},[316,1970,152],{"class":330},[316,1972,1466],{"class":326},[316,1974,1389],{"class":913},[316,1976,1977,1980,1982,1985,1987,1989,1991,1993,1995],{"class":318,"line":750},[316,1978,1979],{"class":832},"      link",[316,1981,886],{"class":326},[316,1983,1984],{"class":832},"href",[316,1986,1026],{"class":326},[316,1988,1841],{"class":832},[316,1990,886],{"class":326},[316,1992,681],{"class":832},[316,1994,886],{"class":326},[316,1996,1997],{"class":832},"url\n",[316,1999,2000,2002,2004,2007,2009,2011,2013,2015,2017],{"class":318,"line":1217},[316,2001,1979],{"class":832},[316,2003,886],{"class":326},[316,2005,2006],{"class":832},"textContent",[316,2008,1026],{"class":326},[316,2010,1841],{"class":832},[316,2012,886],{"class":326},[316,2014,681],{"class":832},[316,2016,886],{"class":326},[316,2018,2019],{"class":832},"text\n",[316,2021,2022,2025,2027,2029,2031,2033,2035,2037,2039,2041,2044,2046,2049],{"class":318,"line":1233},[316,2023,2024],{"class":832},"      document",[316,2026,886],{"class":326},[316,2028,1793],{"class":945},[316,2030,1212],{"class":913},[316,2032,1466],{"class":326},[316,2034,1673],{"class":330},[316,2036,1466],{"class":326},[316,2038,1438],{"class":913},[316,2040,886],{"class":326},[316,2042,2043],{"class":945},"append",[316,2045,1212],{"class":913},[316,2047,2048],{"class":832},"link",[316,2050,1389],{"class":913},[316,2052,2053,2055],{"class":318,"line":1253},[316,2054,1386],{"class":326},[316,2056,1389],{"class":832},[316,2058,2059,2062,2064],{"class":318,"line":1273},[316,2060,2061],{"class":326},"\u003C\u002F",[316,2063,1692],{"class":913},[316,2065,1658],{"class":326},[18,2067,2068],{},"That is the whole integration. From now on the chart follows the account: you trade, the statistics are recomputed, your server picks them up at its next request, and the visitor sees them.",[25,2070,2072],{"id":2071},"more-data-in-the-same-request","➕ More Data in the Same Request",[18,2074,2075,2076,2079],{},"Add sections to ",[298,2077,2078],{},"include",", separated by commas. It is still one request.",[30,2081,2082,2092],{},[33,2083,2084],{},[36,2085,2086,2089],{},[39,2087,2088],{},"You want to show",[39,2090,2091],{},"Ask for",[51,2093,2094,2103,2113,2123,2133,2143],{},[36,2095,2096,2099],{},[56,2097,2098],{},"The growth, balance or drawdown curve, day by day",[56,2100,2101],{},[298,2102,512],{},[36,2104,2105,2108],{},[56,2106,2107],{},"Monthly and yearly returns, and \"this month so far\"",[56,2109,2110],{},[298,2111,2112],{},"monthly",[36,2114,2115,2118],{},[56,2116,2117],{},"Results per instrument",[56,2119,2120],{},[298,2121,2122],{},"by_symbol",[36,2124,2125,2128],{},[56,2126,2127],{},"Results per Expert Advisor, on MT4 and MT5",[56,2129,2130],{},[298,2131,2132],{},"by_magic_number",[36,2134,2135,2138],{},[56,2136,2137],{},"Profit factor, expectancy, Sharpe ratio and the other risk metrics",[56,2139,2140],{},[298,2141,2142],{},"advanced",[36,2144,2145,2148],{},[56,2146,2147],{},"Growth after every single trade",[56,2149,2150],{},[298,2151,2152],{},"twr",[18,2154,2155,2156,886],{},"The format is the same for MT4, MT5, cTrader and TradeLocker, so a site that shows several accounts needs one piece of code. For more accounts on one page, see ",[152,2157,2159],{"href":2158},"\u002Fguides\u002Fshow-multiple-trading-accounts-on-one-page","how to show multiple trading accounts on one page",[25,2161,2163],{"id":2162},"what-the-api-asks-in-return","🤝 What the API Asks in Return",[18,2165,2166,2167,2169],{},"On the free plan, one visible line next to the data: ",[59,2168,719],{},", with a link. The example above prints it already. On the Pro and Ultra plans the line is optional.",[18,2171,2172],{},"It is worth keeping either way. For a published account the link leads to the account page on ShowMyTrades, where a visitor finds the same figures on a page you do not control. A chart you drew yourself, with nothing behind it, asks the reader to take your word. A chart with that link does not.",[25,2174,2176],{"id":2175},"if-an-ai-assistant-is-building-your-site","🤖 If an AI Assistant Is Building Your Site",[18,2178,2179],{},"Give it this page, or these lines:",[307,2181,2185],{"className":2182,"code":2184,"language":710,"meta":312},[2183],"language-text","Show my trading results on my site with the ShowMyTrades API. Do not parse an exported report.\n1. The account is connected at https:\u002F\u002Fshowmytrades.com (free, read-only).\n2. Published account: no API key. Private account: a Developer API Key, sent as\n   \"Authorization: Bearer smt_live_...\" from server-side code only.\n3. GET https:\u002F\u002Fshowmytrades.com\u002Fapi\u002Fv1\u002Faccounts\u002F{slug}?include=equity_curve\n4. Call it from the server, cache the answer for 5 minutes, draw equity_curve.daily_performance\n   (date, twr_percent).\n5. Print attribution.text linked to attribution.url next to the chart.\nFull steps: https:\u002F\u002Fshowmytrades.com\u002Fdocs\u002Fapi\u002Fshow-trading-results-on-your-website\n",[298,2186,2184],{"__ignoreMap":312},[18,2188,2189],{},"An assistant left alone often proposes a script that reads a MetaTrader report. It works on the day it is written. With the API the assistant writes less code, and the chart keeps working after it has finished.",[25,2191,2193],{"id":2192},"faq","❓ FAQ",[18,2195,2196,2199],{},[59,2197,2198],{},"Is the API really free?","\nYes. Connecting the account, the API and the widgets cost nothing. You can make 30 requests per minute with a free key, and 20 per minute per IP address without a key: far more than a site that asks every five minutes needs. The Pro and Ultra plans raise the limit and make the line \"Data from ShowMyTrades\" optional.",[18,2201,2202,2205],{},[59,2203,2204],{},"Do I need an API key?","\nNot for a published account: the request works with no key at all. A private account needs a free Developer API Key, created in the dashboard.",[18,2207,2208,2211],{},[59,2209,2210],{},"How often is the data updated?","\nThe statistics follow the account as trades close. Asking every five minutes, as in the example, is plenty for a chart of daily results.",[18,2213,2214,2217],{},[59,2215,2216],{},"Can I call the API straight from the browser?","\nNo. Call it from your server and pass the result to your page, as in the example. A key in the browser would be visible to anyone, and browsers cannot call this API from another site.",[18,2219,2220,2223],{},[59,2221,2222],{},"Does it work with cTrader and TradeLocker too?","\nYes. The answer has the same format on every platform.",[18,2225,2226,2229],{},[59,2227,2228],{},"Can the API place or close trades?","\nNo. It is read-only, like the connection to your account.",[18,2231,2232,2235,2236,2240],{},[59,2233,2234],{},"I would rather not write any code. What then?","\nUse a ",[152,2237,2239],{"href":2238},"\u002Fguides\u002Ftrading-widgets-and-embeds","widget",": one snippet to paste, and it updates on its own too.",[25,2242,2244],{"id":2243},"related-guides","🔗 Related Guides",[2246,2247,2248,2256,2263,2269,2276],"ul",{},[2249,2250,2251,2255],"li",{},[152,2252,2254],{"href":2253},"\u002Fguides\u002Fmt4-mt5-account-data-json-api","MT4 and MT5 account data as JSON",": every endpoint, with examples in cURL, Python and JavaScript",[2249,2257,2258,2262],{},[152,2259,2261],{"href":2260},"\u002Fguides\u002Ftrading-results-in-google-sheets","Your trading results in Google Sheets",": the same data in a spreadsheet, on a timer",[2249,2264,2265,2268],{},[152,2266,2267],{"href":1614},"How to add live trading results to WordPress",": the widget, and a PHP shortcode for the API",[2249,2270,2271,2275],{},[152,2272,2274],{"href":2273},"\u002Fguides\u002Fbuild-a-track-record-page","How to build a track record page",": what to put around the chart",[2249,2277,2278,2282],{},[152,2279,2281],{"href":2280},"\u002Fdocs\u002Fapi\u002Fshow-trading-results-on-your-website","Show your trading results on your website",": the step-by-step in the API documentation",[2284,2285],"hr",{},[18,2287,2288,2291],{},[152,2289,2290],{"href":165},"Connect your account free",", make one request, and your site has a chart that keeps itself up to date.",[2293,2294,2295],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}",{"title":312,"searchDepth":359,"depth":359,"links":2297},[2298,2299,2300,2301,2302,2303,2304,2305,2306,2307,2308],{"id":27,"depth":359,"text":28},{"id":159,"depth":359,"text":160},{"id":226,"depth":359,"text":227},{"id":304,"depth":359,"text":305},{"id":809,"depth":359,"text":810},{"id":1618,"depth":359,"text":1619},{"id":2071,"depth":359,"text":2072},{"id":2162,"depth":359,"text":2163},{"id":2175,"depth":359,"text":2176},{"id":2192,"depth":359,"text":2193},{"id":2243,"depth":359,"text":2244},"2026-11-30T00:00:00.000Z","Building your own site and want the chart of your MT4, MT5, cTrader or TradeLocker account on it, updating by itself? One free API request returns the data as JSON. Complete code for the server and the page.",false,"md",{"src":2314},"\u002Fimages\u002Fblog\u002Fself-updating-trading-chart-on-your-website-api-hero.svg",{},"\u002Fguides\u002Fself-updating-trading-chart-on-your-website-api",{"title":5,"description":2310},"3.guides\u002F45.self-updating-trading-chart-on-your-website-api",null,"JVIUmUP7AJU76au8xQe_nFWffj5Cz639DRjO5AXpT0I",[2322,2327],{"title":2323,"path":2324,"stem":2325,"description":2326,"children":-1},"A Free Economic Calendar API for Trading Bots","\u002Fguides\u002Ffree-economic-calendar-api-for-trading-bots","3.guides\u002F44.free-economic-calendar-api-for-trading-bots","Where a trading robot can get the economic calendar: the sources people use, what breaks with each, and a free API with no key built for polling from Expert Advisors, cBots, Python and JavaScript.",{"title":2328,"path":2253,"stem":2329,"description":2330,"children":-1},"MT4 and MT5 Account Data as JSON: a Free API for Your Trading Statistics","3.guides\u002F46.mt4-mt5-account-data-json-api","MetaTrader has no web API for your own account. How to read the balance, equity, growth, drawdown, monthly returns, closed trades and open positions of an MT4 or MT5 account as JSON, with a free REST API. Examples in cURL, Python and JavaScript.",[2332,2333,2335,2337,2339,2341],{"path":2316},{"path":2334},"\u002Fde\u002Fguides\u002Fself-updating-trading-chart-on-your-website-api",{"path":2336},"\u002Fes\u002Fguides\u002Fself-updating-trading-chart-on-your-website-api",{"path":2338},"\u002Fid\u002Fguides\u002Fself-updating-trading-chart-on-your-website-api",{"path":2340},"\u002Fja\u002Fguides\u002Fself-updating-trading-chart-on-your-website-api",{"path":2342},"\u002Fzh\u002Fguides\u002Fself-updating-trading-chart-on-your-website-api",1796001600018]