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
Here I've used autocomplete CtrlSpace to expand available options
>>> C.scene.world.node_tree.nodes['Environment Texture'].image
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.
>>> env_img = C.scene.world.node_tree.nodes['Environment Texture'].image
Adding an environment node, given you have a path to the image
>>> world = C.scene.world
>>> world.use_nodes = True
>>> enode = C.scene.world.node_tree.nodes.new("ShaderNodeTexEnvironment")
>>> enode.image = bpy.data.images.load(path)
How to set a background using the cycles render engine with the API