Blender 2.8 - Get Environment Texture Path from UI to python script
Finding things with the python console.

The scene has a world.  context.scene.world. When nodes are being used the object will have a node tree. world.node_tree The tree has nodes. Consult the manual or the many questions / answers re nodes for more info.

Note: The properties space has a world member of context context.world other spaces may not 

Here is a simple example using the python console.  C is a convenience variable C = bpy.context

&gt;&gt;&gt; C.scene.world
bpy.data.worlds['World']

&gt;&gt;&gt; C.scene.world.node_tree
bpy.data.node_groups['Shader Nodetree']


Here I've used autocomplete CtrlSpace to expand available options

&gt;&gt;&gt; C.scene.world.node_tree.nodes['
                                   Background']
                                   Environment Texture']
                                   World Output']
&gt;&gt;&gt; C.scene.world.node_tree.nodes['Environment Texture'].image
bpy.data.images['Untitled']


See that the environment node has an associated image.  Since I've simply added a blank untitled image it has no filepath.  A loaded image will.

&gt;&gt;&gt; env_img = C.scene.world.node_tree.nodes['Environment Texture'].image
&gt;&gt;&gt; env_img.file
                _format
                path
                path_from_user(
                path_raw
&gt;&gt;&gt; env_img.filepath
''


Adding an environment node, given you have a path to the image path

&gt;&gt;&gt; world = C.scene.world
&gt;&gt;&gt; world.use_nodes = True
&gt;&gt;&gt; enode = C.scene.world.node_tree.nodes.new("ShaderNodeTexEnvironment")
&gt;&gt;&gt; enode.image = bpy.data.images.load(path)


Related:

How to set a background using the cycles render engine with the API