Best practices for integrating with xchangeapi.com REST and WebSocket APIs
To ensure high performance, reliability, and security of your financial applications, we recommend following these industry-standard best practices when integrating with the xchangeapi.com REST and WebSocket APIs.
1. Authentication & Security
Treat your API keys as sensitive credentials.
Environment Variables: Never hardcode your API keys in your source code. Use environment variables (e.g., .env files) or secrets management services (AWS Secrets Manager, HashiCorp Vault).
Server-Side Execution: For web applications, always proxy requests through a backend server. Exposing API keys in frontend (client-side) code allows third parties to hijack your quota.
Key Rotation: Regularly rotate your API keys and immediately revoke any keys that may have been compromised.
2. Optimizing API Requests
Efficiently managing your request volume reduces latency and prevents rate-limiting issues.
Use Batch Endpoints: Whenever possible, use batch requests to fetch data for multiple symbols in a single HTTP call rather than iterating through individual tickers.
Filtering and Pagination: Use the limit and offset (or cursor-based pagination) parameters to fetch only the data you need.
Conditional Requests: Utilize E-Tag or Last-Modified headers to avoid re-downloading data that hasn’t changed since your last request.
3. Resilience and Error Handling
Financial markets are volatile; your integration should not be.
Implement Exponential Backoff: If you receive a 429 Too Many Requests or 5xx Server Error, do not immediately retry. Use an exponential backoff strategy (retrying after 1s, 2s, 4s, etc.) to allow the system to recover.
Graceful Degradation: Design your application to handle missing data points or delayed updates. Use stale data with a warning flag if real-time data is momentarily unavailable.
Timeouts: Set reasonable client-side timeouts (e.g., 5-10 seconds for REST calls) to prevent your application threads from hanging indefinitely.
4. Working with Real-time Data (WebSockets)
For high-frequency trading or live dashboards, WebSockets provide the lowest latency.
Connection Heartbeats: Implement a heartbeat (ping/pong) mechanism to detect “zombie” connections that are technically open but no longer receiving data.
Message Buffering: Ensure your application can process incoming messages faster than the stream’s throughput. If your processing logic is heavy, use a message queue (like RabbitMQ or Redis) to decouple data ingestion from processing.
Reconnection Logic: Implement automatic reconnection with a jittered backoff to avoid a “thundering herd” effect on the server during network flickers.
5. Data Integrity and Validation
Precision Handling: Financial values should never be handled as floating-point numbers due to rounding errors. Use decimal-specific libraries (e.g., Decimal in Python, BigDecimal in Java) for all calculations.
Timestamp Synchronization: All xchangeapi.com timestamps are in UTC. Ensure your local environment is synchronized with a reliable NTP server to accurately track market events.
Schema Validation: Use tools like JSON Schema or Protobuf to validate incoming API responses, ensuring your downstream logic doesn’t break if a non-critical field is added to the payload.
6. Caching Strategy
Reduce costs and improve UI responsiveness.
Cache Static Data: Symbols, exchange lists, and historical OHLC data that is older than 24 hours should be cached locally.
Cache-Control Headers: Always respect Cache-Control headers returned by our API to ensure you are not serving outdated financial information.
Pro-Tip for Quants
If you are performing backtesting, we recommend downloading historical datasets as CSV rather than making millions of individual REST requests. This is significantly more performant for large-scale vector operations in libraries like Pandas or NumPy.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"xChangeApi.com","colors":{"primary":"#b75fe3","light":"#9938CA","dark":"#9938CA"},"logo":{"light":"https://mintcdn.com/xchangeapi/wjluIIKvOZxjEvik/logo/light.png?fit=max\u0026auto=format\u0026n=wjluIIKvOZxjEvik\u0026q=85\u0026s=29907fdc32b4f908b7b0cbcaaf707ddd","dark":"https://mintcdn.com/xchangeapi/wjluIIKvOZxjEvik/logo/light.png?fit=max\u0026auto=format\u0026n=wjluIIKvOZxjEvik\u0026q=85\u0026s=29907fdc32b4f908b7b0cbcaaf707ddd"},"favicon":"/favicon.svg","api":{"mdx":{"auth":{"method":"key","name":"api-key"},"server":"https://api.xchangeapi.com/"}},"navbar":{"primary":{"type":"button","label":"Sign in","href":"https://xchangeapi.com/sign-in"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"]},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"xchangeapi","hasAudioNarration":false,"actualSubdomain":"xchangeapi","customDomains":["xchangeapi.com"],"gitSource":{"type":"github","owner":"rrosmus","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{},"buildId":"6ae942ae8b3a7fe7583a0bb9:success","clientVersion":"0.0.4270","searchFilterCounts":[{"language":"default","tag":"HTTP API Reference","count":8},{"language":"default","tag":"Getting Started","count":6},{"language":"default","tag":"Guides \u0026 Recipes","count":5},{"language":"default","tag":"Historical Data","count":3},{"language":"default","tag":"Live Data","count":3},{"language":"default","tag":"Quickstart","count":3},{"language":"default","tag":"Websocket API Reference","count":3},{"language":"default","tag":"Currency Tools","count":1},{"language":"default","tag":"Metadata","count":1}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"/docs","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"guides/best-practices","slug":"/guides/best-practices","pageMetadata":{"title":"Developer Best Practices","description":"Best practices for integrating with xchangeapi.com REST and WebSocket APIs","href":"/guides/best-practices"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Best practices for integrating with xchangeapi.com REST and WebSocket APIs\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,li:`li`,p:`p`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{Heading,Tip}=_components;if(!Heading)_missingMdxReference(`Heading`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`To ensure high performance, reliability, and security of your financial applications, we recommend following these industry-standard best practices when integrating with the xchangeapi.com REST and WebSocket APIs.`}),`\n`,_jsx(Heading,{level:`2`,id:`1-authentication-\u0026-security`,children:`1. Authentication \u0026 Security`}),`\n`,_jsx(_components.p,{children:`Treat your API keys as sensitive credentials.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Environment Variables`}),`: Never hardcode your API keys in your source code. Use environment variables (e.g., `,_jsx(_components.code,{children:`.env`}),` files) or secrets management services (AWS Secrets Manager, HashiCorp Vault).`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Server-Side Execution`}),`: For web applications, always proxy requests through a backend server. Exposing API keys in frontend (client-side) code allows third parties to hijack your quota.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Key Rotation`}),`: Regularly rotate your API keys and immediately revoke any keys that may have been compromised.`]}),`\n`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`2-optimizing-api-requests`,children:`2. Optimizing API Requests`}),`\n`,_jsx(_components.p,{children:`Efficiently managing your request volume reduces latency and prevents rate-limiting issues.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Use Batch Endpoints`}),`: Whenever possible, use batch requests to fetch data for multiple symbols in a single HTTP call rather than iterating through individual tickers.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Filtering and Pagination`}),`: Use the `,_jsx(_components.code,{children:`limit`}),` and `,_jsx(_components.code,{children:`offset`}),` (or cursor-based pagination) parameters to fetch only the data you need.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Conditional Requests`}),`: Utilize E-Tag or Last-Modified headers to avoid re-downloading data that hasn’t changed since your last request.`]}),`\n`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`3-resilience-and-error-handling`,children:`3. Resilience and Error Handling`}),`\n`,_jsx(_components.p,{children:`Financial markets are volatile; your integration should not be.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Implement Exponential Backoff`}),`: If you receive a 429 Too Many Requests or 5xx Server Error, do not immediately retry. Use an exponential backoff strategy (retrying after 1s, 2s, 4s, etc.) to allow the system to recover.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Graceful Degradation`}),`: Design your application to handle missing data points or delayed updates. Use stale data with a warning flag if real-time data is momentarily unavailable.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Timeouts`}),`: Set reasonable client-side timeouts (e.g., 5-10 seconds for REST calls) to prevent your application threads from hanging indefinitely.`]}),`\n`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`4-working-with-real-time-data-websockets`,children:`4. Working with Real-time Data (WebSockets)`}),`\n`,_jsx(_components.p,{children:`For high-frequency trading or live dashboards, WebSockets provide the lowest latency.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Connection Heartbeats`}),`: Implement a heartbeat (ping/pong) mechanism to detect “zombie” connections that are technically open but no longer receiving data.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Message Buffering`}),`: Ensure your application can process incoming messages faster than the stream’s throughput. If your processing logic is heavy, use a message queue (like RabbitMQ or Redis) to decouple data ingestion from processing.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Reconnection Logic`}),`: Implement automatic reconnection with a jittered backoff to avoid a “thundering herd” effect on the server during network flickers.`]}),`\n`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`5-data-integrity-and-validation`,children:`5. Data Integrity and Validation`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Precision Handling`}),`: Financial values should never be handled as floating-point numbers due to rounding errors. Use decimal-specific libraries (e.g., `,_jsx(_components.code,{children:`Decimal`}),` in Python, `,_jsx(_components.code,{children:`BigDecimal`}),` in Java) for all calculations.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Timestamp Synchronization`}),`: All xchangeapi.com timestamps are in UTC. Ensure your local environment is synchronized with a reliable NTP server to accurately track market events.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Schema Validation`}),`: Use tools like JSON Schema or Protobuf to validate incoming API responses, ensuring your downstream logic doesn’t break if a non-critical field is added to the payload.`]}),`\n`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`6-caching-strategy`,children:`6. Caching Strategy`}),`\n`,_jsx(_components.p,{children:`Reduce costs and improve UI responsiveness.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Cache Static Data`}),`: Symbols, exchange lists, and historical OHLC data that is older than 24 hours should be cached locally.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Cache-Control Headers`}),`: Always respect Cache-Control headers returned by our API to ensure you are not serving outdated financial information.`]}),`\n`]}),`\n`]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Pro-Tip for Quants`}),`\nIf you are performing backtesting, we recommend downloading historical datasets as CSV rather than making millions of individual REST requests. This is significantly more performant for large-scale vector operations in libraries like Pandas or NumPy.`]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Developer Best Practices","description":"Best practices for integrating with xchangeapi.com REST and WebSocket APIs","href":"/guides/best-practices"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"1. Authentication \u0026 Security","slug":"1-authentication-\u0026-security","depth":2,"children":[]},{"title":"2. Optimizing API Requests","slug":"2-optimizing-api-requests","depth":2,"children":[]},{"title":"3. Resilience and Error Handling","slug":"3-resilience-and-error-handling","depth":2,"children":[]},{"title":"4. Working with Real-time Data (WebSockets)","slug":"4-working-with-real-time-data-websockets","depth":2,"children":[]},{"title":"5. Data Integrity and Validation","slug":"5-data-integrity-and-validation","depth":2,"children":[]},{"title":"6. Caching Strategy","slug":"6-caching-strategy","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/docs/_mintlify/custom/xchangeapi/495ba753a52db71e/websocket/example-implementation/js/websocket.js","/docs/_mintlify/custom/xchangeapi/48911bb8c68ad74b/websocket/example-implementation/node/client.js"],"subdomain":"xchangeapi","siteName":"xChangeApi.com","title":"Developer Best Practices - xChangeApi.com","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"originalFileLocation":"guides/best-practices.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Best practices for integrating with xchangeapi.com REST and WebSocket APIs\">\u003cmeta data-mint-head name=\"application-name\" content=\"xChangeApi.com\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/xchangeapi/wHHzBy3GmlwqcEnG/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/xchangeapi/wHHzBy3GmlwqcEnG/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/xchangeapi/wHHzBy3GmlwqcEnG/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/xchangeapi/wHHzBy3GmlwqcEnG/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/xchangeapi/wHHzBy3GmlwqcEnG/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/xchangeapi/wHHzBy3GmlwqcEnG/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/xchangeapi/wHHzBy3GmlwqcEnG/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/xchangeapi/wHHzBy3GmlwqcEnG/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/xchangeapi/wHHzBy3GmlwqcEnG/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Developer Best Practices - xChangeApi.com\">\u003cmeta data-mint-head property=\"og:description\" content=\"Best practices for integrating with xchangeapi.com REST and WebSocket APIs\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"xChangeApi.com\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://xchangeapi.com/docs/guides/best-practices\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://xchangeapi.mintlify.site/docs/_mintlify/api/og/v2?division=Guides+%26+Recipes\u0026amp;title=Developer+Best+Practices\u0026amp;description=Best+practices+for+integrating+with+xchangeapi.com+REST+and+WebSocket+APIs\u0026amp;theme=9ac6bf1a0da426ccc92107b9\u0026amp;signature=3e34f79eebb8eb4ff35c8c3554628b48a860a109acd47218d0456adbd18ecaf1\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Developer Best Practices - xChangeApi.com\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Best practices for integrating with xchangeapi.com REST and WebSocket APIs\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://xchangeapi.mintlify.site/docs/_mintlify/api/og/v2?division=Guides+%26+Recipes\u0026amp;title=Developer+Best+Practices\u0026amp;description=Best+practices+for+integrating+with+xchangeapi.com+REST+and+WebSocket+APIs\u0026amp;theme=9ac6bf1a0da426ccc92107b9\u0026amp;signature=3e34f79eebb8eb4ff35c8c3554628b48a860a109acd47218d0456adbd18ecaf1\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/xchangeapi/wHHzBy3GmlwqcEnG/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"xChangeApi.com\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#b75fe3\">\u003clink data-mint-head rel=\"canonical\" href=\"https://xchangeapi.com/docs/guides/best-practices\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/guides/best-practices.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://xchangeapi.com/#organization\",\"name\":\"xChangeApi.com\",\"url\":\"https://xchangeapi.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/xchangeapi/wjluIIKvOZxjEvik/logo/light.png?fit=max\u0026auto=format\u0026n=wjluIIKvOZxjEvik\u0026q=85\u0026s=29907fdc32b4f908b7b0cbcaaf707ddd\"}},{\"@type\":\"WebSite\",\"@id\":\"https://xchangeapi.com/docs#website\",\"name\":\"xChangeApi.com\",\"url\":\"https://xchangeapi.com/docs\",\"publisher\":{\"@id\":\"https://xchangeapi.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://xchangeapi.com/docs/guides/best-practices#webpage\",\"url\":\"https://xchangeapi.com/docs/guides/best-practices\",\"name\":\"Developer Best Practices\",\"description\":\"Best practices for integrating with xchangeapi.com REST and WebSocket APIs\",\"isPartOf\":{\"@id\":\"https://xchangeapi.com/docs#website\"},\"breadcrumb\":{\"@id\":\"https://xchangeapi.com/docs/guides/best-practices#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://xchangeapi.com/docs/guides/best-practices#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Guides \u0026 Recipes\",\"item\":\"https://xchangeapi.com/docs/guides/available-currencies\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Developer Best Practices\",\"item\":\"https://xchangeapi.com/docs/guides/best-practices\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://xchangeapi.com/docs/guides/best-practices#article\",\"headline\":\"Developer Best Practices\",\"name\":\"Developer Best Practices\",\"description\":\"Best practices for integrating with xchangeapi.com REST and WebSocket APIs\",\"url\":\"https://xchangeapi.com/docs/guides/best-practices\",\"mainEntityOfPage\":{\"@id\":\"https://xchangeapi.com/docs/guides/best-practices#webpage\"},\"publisher\":{\"@id\":\"https://xchangeapi.com/#organization\"},\"isPartOf\":{\"@id\":\"https://xchangeapi.com/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"xChangeApi.com\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"xChangeApi.com\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/docs/guides/best-practices.md","siteName":"xChangeApi.com","nav":{"global":null,"groups":[{"group":"Getting Started","pages":[{"title":"Introduction","href":"/introduction"},{"group":"Quickstart","pages":[{"title":"Quickstart","href":"/quickstart"},{"title":"HTTP API Quickstart","href":"/quickstart/http-api"},{"title":"WebSocket API Quickstart","href":"/quickstart/websocket-api"}]},{"title":"Authentication","href":"/authentication"},{"title":"Rate Limits","href":"/rate-limits"}]},{"group":"HTTP API Reference","pages":[{"group":"Live Data","pages":[{"title":"Latest rates","api":"GET latest?base={base}","href":"/http/live-data/latest"},{"title":"Single currency rate","api":"GET {format}/currencies/{currency-pair}","href":"/http/live-data/single-currency"},{"title":"Multiple currencies rates","api":"GET {format}/currencies?pairs={currency-pairs}","href":"/http/live-data/many-currencies"},{"title":"Symbols","href":"/http/metadata/symbols"}]},{"group":"Historical Data","pages":[{"title":"Historical rates","api":"GET historical/{date}","href":"/http/historical-data/historical"},{"title":"OHLC chart data for date range","api":"GET {format}/chart/{currency-pair}?starttime={starttime}\u0026endtime={endtime}","href":"/http/historical-data/ohlc-date-range"},{"title":"OHLC chart data for selected period","api":"GET {format}/chart/{currency-pair}/{period}","href":"/http/historical-data/ohlc-period"}]},{"group":"Currency Tools","pages":[{"title":"Currency conversion","api":"GET convert?amount={amount}\u0026from={from}\u0026to={to}","href":"/http/currency-tools/convert"}]},{"group":"Metadata","pages":[{"title":"Multipliers","api":"GET currencies/multipliers","href":"/http/metadata/multipliers"}]}]},{"group":"Websocket API Reference","pages":[{"title":"Protocol description","href":"/websocket/protocol"},{"title":"Available message codes","href":"/websocket/message-codes"},{"title":"Example implementation","href":"/websocket/example-implementation"}]},{"group":"Guides \u0026 Recipes","pages":[{"title":"Available Currencies","href":"/guides/available-currencies"},{"title":"Available Cryptocurrencies","href":"/guides/available-cryptocurrencies"},{"title":"Data Formats","href":"/guides/response-formatting"},{"title":"Response Structures","description":"Understand the format and properties of API responses for live and historical data.","href":"/guides/data-properties"},{"title":"Developer Best Practices","href":"/guides/best-practices"}]}]},"basePath":"","title":"Developer Best Practices - xChangeApi.com","deploymentId":"dpl_53YqbBPsHdrqSGqXiWPGU7csRVod","buildId":"dpl_53YqbBPsHdrqSGqXiWPGU7csRVod","dynamics":[],"chunks":[]}