0 Draft Bible Embed Shared by Garrett Johnson, Spark Development Network 6 years ago 8.5 Web Intermediate To access the API, you must be create an API Application https://bibles.org/pages/api/signup. Once you have created your API Application you can make calls to the API and retrieve content using the application's private API key. The Bibles.org API Includes: (NASB) New American Standard Bible (MSG) The Message (KJV) King James Version (CEVD) Contemporary English Version (US Version) (AMP) Amplified Bible (GNTD) Good News Translation ESV {% assign translation = 'kjv' %} {% assign translation = translation | Downcase %} {% assign verse = 'ps 27:1-10' %} {% assign verse = verse | Trim | Replace:' ','+' | Replace:':','%3A' | Replace:'&','' %} {% assign bibles_api_key = 'YOURBIBLESAPIKEY' %} {% assign esv_api_key = 'YOURESVAPIKEY' %} {% stylesheet id:'bible-shortcode' %} .scripture sup, .esv-api b.verse-num, .esv-api b.chapter-num { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; top: -0.5em; font-weight: 400; } .bibles-org-api sup::after, .bibles-org-api sup::before { content:" "; } {% endstylesheet %} {%- cache key:'shortcode-{{ translation }}-{{ verse }}' duration:'3600' twopass:'false' tags:'bible-shortcode' -%} {% capture api_output %} {% if bibles_api_key != '' and translation != 'esv' %} {% capture url %}http://bibles.org/v2/eng-{{ translation | Upcase }}/passages.js?q[]={{ verse }}{% endcapture %} {% webrequest url:'{{ url }}' basicauth:'{{ bibles_api_key }},xxx' return:'json' timeout:'1' %} {% if json.response.search.result.type == 'passages' %} {% for passage in json.response.search.result.passages %} <div class="scripture bibles-org-api translation-{{ passage.version_abbreviation | Downcase }}" data-verse="{{ verse }}"> {{ passage.text }} - {{ passage.display }} ({{ passage.version_abbreviation }}) <!-- {{ passage.copyright }} --> </div> {% endfor %} {% endif %} <!-- Bibles.org Fair Use Image DO NOT REMOVE --> {{ json.response.meta.fums_noscript }} {% endwebrequest %} {% elseif esv_api_key != '' and translation == 'esv' %} {% capture url %}https://api.esv.org/v3/passage/html/?q={{ verse }}&include-passage-references=false&include-footnotes=false&include-audio-link=false&include-short-copyright=false&include-chapter-numbers=false{% endcapture %} {% webrequest url:'{{ url }}' headers:'Authorization^Token {{ esv_api_key }}' return:'json' timeout:'1' %} <div class="scripture esv-api translation-esv" data-verse="{{ verse }}"> {{ json.passages }} - {{ json.canonical }} (<a href="https://www.esv.org/">ESV</a>) </div> {% endwebrequest %} {% endif %} {% endcapture %} {%- endcache -%} {% assign isInvalid = api_output | Trim | RegExMatch:'^Liquid error' %} {% if isInvalid %} Error {% else %} {{ api_output }} {% endif %}