vizwan Posted September 5 Share Posted September 5 I am new to Squarespace. I want to display info from a third party API that is in json format. I would appreciate any suggestions on how to do it. I tried using Code Block and it shows the code as is on the page. Thanks in advance! Link to comment
creedon Posted September 5 Share Posted September 5 The first question to answer is what display format would you like it to be in? JSON can be reformatted with JavaScript into a number of other display formats. Is the code you mention just the raw JSON output from the API or are you calling the API on the fly and it returns JSON to you in a code block? Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
vizwan Posted September 5 Author Share Posted September 5 Thanks @creedon. Yes. I tried to reformat with JavaScript. I tried a couple of simple codes in code block but it just displays the code as is in preview and saved mode (I signed up for the business plan and this should not be an issue because of trial/ basic subscription per help center). The latter option would be awesome, getting real time results from the API. Do you know if it can work in a code block? Link to comment
creedon Posted September 5 Share Posted September 5 Sounds like you turned the Display Source Code toggle on. It should be off to run code. I have no clue if the API can be used real time. You would need to read up on the docs from the API provider. Many providers charge a fee to use their API and that may vary based on volume of calls. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
vizwan Posted September 5 Author Share Posted September 5 Thank you, I'll look into it. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment