Getting Wikidata Query results in JSON

Method 1 - GET request

Use a standard GET request, with the SPARQL code appropriately escaped

https://query.wikidata.org/bigdata/namespace/wdq/sparql?format=json&query=SELECT%20%3Fitem%20%3FitemLabel%20%0AWHERE%20%0A%7B%0A%20%20%3Fitem%20wdt%3AP31%20wd%3AQ146.%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Cen%22.%20%7D%0A%7D

Method 2 - POST request API call from Python

Use a POST request to get the JSON, then convert the result into a Pandas Dataframe, a 2D data structure.