Loading directory of JSON files with PyQGIS

Using a plugin:

You can load JSON files from a directory structure, applying a prefix filter, using the Load Them All plugin v3.2.0.

Load Them All will recognize sublayers into each JSON file and load them properly.

Look at the docs to see some screencasts and details.


Using PyQGIS:

With the following script you can load your JSON layers and sublayers to QGIS (the script is extracted from Load Them All):

import os
import glob

json_paths = glob.glob('/path/to/jsons/dir/land*.json')
layer_paths = list()  # List of layer paths to load

for json_path in json_paths:
  layer = QgsVectorLayer(json_path, "", "ogr")

  if layer.isValid():
      # Do we have sublayers?
      if len(layer.dataProvider().subLayers()) > 1:
          sublayers = dict()

          for sublayer in layer.dataProvider().subLayers():
              # Sample: 
              # ['0!!::!!my_layer!!::!!12!!::!!LineString!!::!!geometryProperty']
              parts = sublayer.split("!!::!!")  # 1: name, 3: geometry type
              # Sublayers might share layer name, 
              # we need to get geometry types just in case
              if parts[1] in sublayers:
                  sublayers[parts[1]].append(parts[3])
              else:
                  sublayers[parts[1]] = [parts[3]]

          # Let's create layer paths for sublayers
          for sublayer_name,sublayer_geometries in sublayers.items():
              if len(sublayer_geometries) > 1:
                  for sublayer_geometry in sublayer_geometries:
                      layer_paths.append(
                          "{}|layername={}|geometrytype={}".format(json_path, 
                                                               sublayer_name, 
                                                               sublayer_geometry))
              else:
                  layer_paths.append("{}|layername={}".format(json_path, 
                                                              sublayer_name))
      else:
          layer_paths.append(json_path)  # Load JSON as normal OGR layer

# Finally, load all layers!
layers = list()
for layer_path in layer_paths:
    layers.append(QgsVectorLayer(layer_path, os.path.basename(layer_path), "ogr"))

QgsProject.instance().addMapLayers(layers)

As you can see, sublayers will load with very long names. For reference, you can see here how Load Them All gets short names for sublayers.