Free: api.sportradar.com

api.sportradar.com gives you a ton of sports-data. You need an API-Key for that to get data with a simple URL like this:
https://api.sportradar.com/soccer-extended/trial/v4/en/seasons/sr:season:83706/competitors/sr:competitor:38/statistics.json?api_key=YOUR_API_KEY

Local stored JSON:
http://api.json-content-importer.com/extra/json/sportradar/statistics.json
Shortcode for that:

[jsoncontentimporter url=http://api.json-content-importer.com/extra/json/sportradar/statistics.json oneofthesewordsmustbein="Cesar" oneofthesewordsmustbeindepth="2" basenode=competitor.players]
name: {name}<br>
minutes_played: {subloop:statistics:-1}id: {statistics.minutes_played}<br>{/subloop:statistics}
[/jsoncontentimporter]

In Action:


name: Azpilicueta, Cesar
minutes_played: id: 1394

Free: wordpress.org API

wordpress.org provides an JSON-API. That’s exactly what this plugin is for.
Basic data for the free version at wordpress.org is at https://api.wordpress.org/plugins/info/1.0/json-content-importer.json

Template:
What’s it about? The above “About the free Plugin” is livedata from the wordpress.org API – the shortcode with the free version is as following:

[jsoncontentimporter url=”https://api.wordpress.org/plugins/info/1.0/json-content-importer.json”]Version: {version}<br>{downloaded} Downloadsybr>{num_ratings} Ratings: {rating}%[/jsoncontentimporter]

This Shortcode in action:

Version: 1.3.13
221476 Downloads
64 Ratings: 98%

API: Details verkehr.autobahn.de/o/…

https://verkehr.autobahn.de/o/autobahn/details/warning/{warning.identifier}
gives details of a warnings (list of warnings, see here)

Local stored JSON: http://api.json-content-importer.com/extra/json/nZpel9fTE1TLU5JL3JfTE1TLU5JLzI0MDQ5M19EICBOSSBMTVMtTkkgIC4w.json

JCI-Template:

  • name: detail-autobahn
  • URL:
    “dummyrequest” does not do a http-request but gives basic info about the page. With that you can catch errors etc.
{% set url = "dummyrequest" %}
{% if urlparam.warningid %}
{% set url = "https://verkehr.autobahn.de/o/autobahn/details/warning/" ~ urlparam.warningid %}
{% endif %}
{{url}}
  • urlparam4twig: warningid
  • twig-template:
<a href="/api-verkehr-autobahn-de-o/">back to list</a><hr>
{% if subtitle %}
    <strong>{{subtitle}}</strong><br>
    {{description.0}}<br>
    coordinates: {{coordinate.lat}},{{coordinate.long}}<br>
    {% for k,v in description %}
        {% if v %}
            {{v}}<br>
        {% endif %}
    {% endfor %}
{% else %}
no warning found
{% endif %}

Shortcode:

[jsoncontentimporterpro nameoftemplate="detail-autobahn"]

In Action:

back to list
no warning found

PRO: oAuth2-Demo by using Shortcode in twig-code

This pages shows you how to get access to the data at
http://api.json-content-importer.com/extra/api/getdata.php?gd=acc

This API / URL expects:

  • Useragent: mozilla
  • HTTP-Header with “Authorization:Bearer TOKEN”
  • “TOKEN” has to be obtained from
    http://api.json-content-importer.com/extra/api/gettoken.php
    For that user / password has to be sent by CURL-POST.

This is called oAuth2, to avoid sending user / password via http, but a TOKEN the API can check if user / password is ok.

We need two JCI-Shortcodes for that.

JCI-Template 1: The Shortcode (orderofshortcodeeval=1 tells the plugin to first execute the twig code and then the Shortcode – 10 would not execute the Shortcode, then you can see the TOKEN…)

[jsoncontentimporterpro nameoftemplate="demo-oauth" orderofshortcodeeval=1]

is for the page which will show us the data.

Defined it like this:

  • Name: demo-oauth
  • URL: http://api.json-content-importer.com/extra/api/gettoken.php
  • method: CURL-POST
  • curloptions: CURLOPT_POSTFIELDS={“user”: “test”, “password”: “mypass”}
  • twig-template:
test<br>
[jsoncontentimporterpro nameoftemplate="demo-oauth2" curloptions="CURLOPT_USERAGENT=mozilla;CURLOPT_HTTPHEADER=Authorization:Bearer {{access_token}}"]

Ok, we need JCI-Template 2:

  • name: demo-oath2
  • URL: http://api.json-content-importer.com/extra/api/getdata.php?gd=acc
  • method: CURL-GET
  • curloptions: are sent from the other JCI-Template, where this Shortcode is used
  • twig-template:
{% if datasuccess %}
{% for b in boat %}
boat-id: {{b.id}}<br>
{% endfor %}
<hr>
{% for h in harbour %}
harbour-id: {{h.id}}<br>
{% endfor %}
{% endif %}

In Action:

test
boat-id: 6447084
boat-id: 1358438
boat-id: 2756273
boat-id: 5187202
boat-id: 336015
boat-id: 4505303

harbour-id: 3995730
harbour-id: 1419380

Create JSON out of JSON: Use it for a liveticker with “Auto Refresh API Ajax”

Challenge: Display the data from https://waterservices.usgs.gov/nwis/iv/?format=json&sites=01407600&parameterCd=72279&siteStatus=active

Local JSON stored at http://api.json-content-importer.com/extra/json/waterservices.usgs.gov.json

Simply displaying data is easy – create a Plugin template with the above URL and this Twigcode (Shortcode: [jsoncontentimporterpro nameoftemplate=NAME_OF_TEMPLATE])

Location:  {{value.timeSeries.0.sourceInfo.siteName}}<br>
Date: {{value.timeSeries.0.values.0.value.0.dateTime | date("Y-m-d",   "America/New_York") }} <br>
Time: {{value.timeSeries.0.values.0.value.0.dateTime | date("H:i",  "America/New_York") }}<br>
Water Level: {{value.timeSeries.0.values.0.value.0.value}}

In Action:

Location: Shrewsbury River at Sea Bright NJ
Date: 2022-06-27
Time: 03:30
Water Level: -1.34

Display this data with the “Auto Refresh API Ajax” Plugin- Way 1:

  • Install the Plugin
  • Create a HTML-Div like <div id="araatest">load data</div>
  • Go to the “Auto Refresh AA” menu and insert this:
  • URL: See above
  • What: value.timeSeries.0.values.0.value.0.value
  • Where: div[id="araatest"]

Display this data with the “Auto Refresh API Ajax” Plugin- Way 2:

Create a new JSON-Feed with the JCI-PRO-Plugin by adding a new plugin-template:

  • Name: waterservices-json
  • URL: https://waterservices.usgs.gov/nwis/iv/?format=json&sites=01407600&parameterCd=72279&siteStatus=active
  • twig-template:
{"time": "{{"now" | date("d.m.Y, H:i:s") }}", "data": "Location:  {{value.timeSeries.0.sourceInfo.siteName}}, Date: {{value.timeSeries.0.values.0.value.0.dateTime | date("Y-m-d",   "America/New_York") }}, Time: {{value.timeSeries.0.values.0.value.0.dateTime | date("H:i:s",  "America/New_York") }}, Water Level: {{value.timeSeries.0.values.0.value.0.value}}"}

Shortcode:

[jsoncontentimporterpro nameoftemplate="waterservices-json"]

This page with this Shortcode should be something like this:
http://api.json-content-importer.com/json-waterservices-usgs-gov/
Adding “?show=oc” removes the template and gives pure JSON:
http://api.json-content-importer.com/json-waterservices-usgs-gov/?show=oc

This JSON we can use in “Auto Refresh API Ajax”:

Example in Action:
load data

Free: Current NYT Book-Bestseller

With the free JSON Content Importer Plugin you can display the New York Times Bestseller-Booklist:

Get a NYT-API-Key and you get JSON from
https://api.nytimes.com/svc/books/v3/lists/current/hardcover-fiction.json?api-key=…
local stored JSON: http://api.json-content-importer.com/extra/json/nyt-hardcover-fiction.json

Shortcode for that:

[jsoncontentimporter url=https://api.nytimes.com/svc/books/v3/lists/current/hardcover-fiction.json?api-key=YOUR_NYT_API_BOOK_KEY basenode=results]
{list_name}<br>{subloop-array:books:-1}<img src="{books.book_image}" title="{books.title}" align="left" width="40" hspace="5"> {books.rank}. <a href="{books.amazon_product_url}" target="_blank">{books.title}</a><br>{books.description}<br clear="all"> <hr>{/subloop-array:books}
[/jsoncontentimporter]

In Action:


Hardcover Fiction
1. THE MAID
When a wealthy man is found dead in his room, a maid at the Regency Grand Hotel becomes a lead suspect.


2. THE MIDNIGHT LIBRARY
Nora Seed finds a library beyond the edge of the universe that contains books with multiple possibilities of the lives one could have lived.


3. THE LINCOLN HIGHWAY
Two friends who escaped from a juvenile work farm take Emmett Watson on an unexpected journey to New York City in 1954.


4. THE HORSEWOMAN
As the Paris Olympics draw near, a mother and daughter, who are champion horse riders, compete against each other.


5. THE LAST THING HE TOLD ME
Hannah Hall discovers truths about her missing husband and bonds with his daughter from a previous relationship.


6. THE JUDGE'S LIST
The second book in the Whistler series. Investigator Lacy Stoltz goes after a serial killer and closes in on a sitting judge.


7. DEVIL HOUSE
A crime writer re-examines his work after moving into a house where a pair of briefly notorious murders took place.


8. VIOLETA
A woman whose life spans 100 years recounts personal and historical events through letters to someone she loves.


9. THE MAGNOLIA PALACE
An English model stumbles upon messages that might uncover the truth behind a decades-old murder in the Frick family.


10. THE STRANGER IN THE LIFEBOAT
After a ship explodes, 10 people struggling to survive pull a man who claims to be the Lord out of the sea.


11. WISH YOU WERE HERE
Diana O’Toole re-evaluates her seemingly perfect life when a pandemic disrupts her vacation in the Galápagos Islands.


12. CLOUD CUCKOO LAND
An interconnected cast of dreamers and outsiders are in dangerous and disparate settings past, present and future.


13. CALL US WHAT WE CARRY
A debut collection of poems on identity and history by the presidential inaugural poet who wrote “The Hill We Climb.”


14. THE WISH
Maggie Dawes, a renowned travel photographer, struggles with a medical diagnosis over Christmas.


15. ONE STEP TOO FAR
The second book in the Frankie Elkin series. Frankie searches for a young man who went missing during a bachelor party camping trip.



PRO: Plot JSON-data – WordPress Charts Plugin

Together with the Plugin “WordPress Charts” the PRO version of the JSON Content Importer can plot data in many ways. Unfortunately this plugin isn’t availiable in the WP-Repository any more.

Example: https://api.wordpress.org/stats/plugin/1.0/downloads.php?slug=json-content-importer&limit=51 gives us the latest 50 numbers of the downloads of the free JCI plugin. The challenge is to display that data like this:

Downloads of the free JSON Content Importer Plugin: Daily statistic of the last 50 days

For that we have to do this:

Name of template: wordpress-stat-plot
Install: WordPress Charts
Create a new JCI-pro-template with:

URL: https://api.wordpress.org/stats/plugin/1.0/downloads.php?slug=json-content-importer&limit=51

twig-template:

<a href="https://wordpress.org/plugins/json-content-importer/" target="_blank">Downloads of the free JSON Content Importer Plugin:</a> <a href="https://api.wordpress.org/stats/plugin/1.0/downloads.php?slug=json-content-importer&limit=51" target="_blank">Daily statistic of the last 50 days</a><br>{%set no = 0 %}
{% for dat,nodl in _parent %}{%set no = (_parent | length)-1 %}{% endfor %}

Save that template and use it on a page with the above shortcode

That’s it…

Free: API trustatrader.com

Request via wordpress.org: “no feed coming through”

Question: “Can’t get raw data from this feed to show up at all. Not sure what I am missing: https://www.trustatrader.com/api/consumer-reviews?username=CWYAONE&format=json

I saved this JSON to http://api.json-content-importer.com/extra/json/blog/trustatrader_com.json to have this example independent from external sites.

How to add this data to a WordPress page?
My way: Create a new page and add a “JSON Content Importer Free”-Block.

There use the above URL and switch on the debug mode.
Open https://jsoneditoronline.org in a new Browser-Tab and copypaste the JSON there: You’ll see that “consumer_reviews_api” is the wrapping name. Use this as basenode in the Block.
You also see a object “trader” with the item “reviews”.
With the Gutenberg-Block you can try templates and you see at once if it’s working or not:


The syntax of the free plugin-template is

{subloop:trader:-1}
company_name: {company_name}
{/subloop:trader}

Similar it is with the array “reviews”. Hence the syntax is

{subloop-array:reviews:-1}
reviewer_name: {reviewer_name}<br>
{/subloop-array:reviews}

So the whole shortcode is (if you don’T want to have a Gutenberg-Block):

[jsoncontentimporter url=http://api.json-content-importer.com/extra/json/blog/trustatrader_com.json numberofdisplayeditems=-1 basenode=consumer_reviews_api urlgettimeout=5]
{subloop:trader:-1}
company_name: {company_name}
{/subloop:trader}<br>
{subloop-array:reviews:-1}
reviewer_name: {reviewer_name}<br>
{/subloop-array:reviews}
[/jsoncontentimporter]

In Action:

company_name: C Wyatt Gas Services
reviewer_name: Nick Digman
reviewer_name: Rob Selby
reviewer_name: Chris Swinburn
reviewer_name: Sam Sophie
reviewer_name: S Ho

Free: API presseportal.de

The API of presseportal.de with Demo-Page:

[jsoncontentimporter url="http://api.json-content-importer.com/extra/json/presseportalde.json" basenode="content"]
{subloop-array:story:-1}<a href="{url}" target="_blank">{title}</a><hr>{/subloop-array:story}
[/jsoncontentimporter]

gives you:


"nd.DerTag": Akelius beginnt mit Verkauf von Eigentumswohnungen in Berlin


Frankfurter Rundschau: Pressestimme zu AfD und Kalbitz


Maas: Ein neuer US-Präsident bringt keine Kehrtwende in der Außenpolitik


Greenpeace Aktivistinnen und Aktivisten errichten steinerne Barriere für echten Meeresschutz Granitsteine sollen artenreiches Steinriff im Schutzgebiet Adlergrund bewahren


"Ob der Abbau von Krankenhausbetten klug ist?" / Serdar Yüksel (SPD) fordert Überprüfung der Krankenhausrahmenplanung in NRW (FOTO)


Tagessieg für Florian Silbereisen und "Schlager, Stars & Sterne - Die große Seeparty in Österreich" Die Show begeisterte gestern Abend 4,31 Millionen Zuschauer


PAN AMP veröffentlicht TASKFORCE CLOUD (FOTO)


Blasenentzündung heilt auch ohne Antibiotikum


Trauriger Rekord: Halb Syrien hungert / SOS-Kinderdörfer: Inflation lässt die Not massiv ansteigen (FOTO)


Der Tourismus der historischen Hauptstadt Xi'an erholt sich allmählich


Tagesspiegel exklusiv: Berliner CDU wirbt für Führungsduo Söder/Spahn


Fairer Wettbewerb - Kommentar von Dominik Bath


AfD-Bundesschiedsgericht bestätigt die Annullierung der Mitgliedschaft von Andreas Kalbitz


RTL/ntv-Trendbarometer / FORSA-AKTUELL: Parteiwerte unverändert - Söder als Kanzlerkandidat vor Habeck und Scholz - 66 Prozent der Unions-Anhänger wollen Führungs-Duo Söder/Spahn


Berliner Ärztekammer begrüßt Beschluss der Gesundheitsminister zu Corona-Tests für Reiserückkehrer


Helge Braun: "Es wird ein aufwendiges Schuljahr"


Fleischwirtschaft warnt: Preise steigen durch Werkvertrag-Verbot um bis zu 20 Prozent


Rückkehr der Fans in Fußballstadien: Bremen und NRW wollen "sehr genau" prüfen


Tui schließt neuen Hilfsantrag nicht aus


Tui-Chef will Touristengebiete in der Türkei von Reisewarnung freistellen lassen