# How to get URL of new graph when it's generated?

**URL:** <https://community.plotly.com/t/how-to-get-url-of-new-graph-when-its-generated/8377>\
**Category:** 📊 Plotly Python\
**Created:** [February 15, 2018, 8:07pm UTC](https://community.plotly.com/t/how-to-get-url-of-new-graph-when-its-generated/8377 "2018-02-15T20:07:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajf6347](https://avatars.discourse-cdn.com/v4/letter/a/258eb7/32.png) [@ajf6347](https://community.plotly.com/u/ajf6347)\
**Post date:** [February 15, 2018, 8:07pm UTC](https://community.plotly.com/t/how-to-get-url-of-new-graph-when-its-generated/8377/1 "2018-02-15T20:07:53Z")

</div>

Greetings,

I am generating the data for a graph within a python program, and ultimately creating a graph by calling the “.plot” method of the plotly class.

After the call, the newly generated graph is displayed in a browser window.

I am wondering if there’s any way within the python program to get the exact URL of the newly created graph so that I could save it automatically?

Best Regards,

Adam

---

<div class="post-metadata">

**Author:** ![empet](https://avatars.discourse-cdn.com/v4/letter/e/977dab/32.png) [@empet](https://community.plotly.com/u/empet)\
**Post date:** [February 16, 2018, 11:45am UTC](https://community.plotly.com/t/how-to-get-url-of-new-graph-when-its-generated/8377/2 "2018-02-16T11:45:45Z")

</div>

@ajf6347 Extract the URL assigned to you plot as follows:

`url=py.iplot(fig, filename='your_filename')`

Then you can print or save the string `url.resource`, i.e. a string that gives the URL of your plot:  
`'https://plot.ly/~your_username/14797'`.

---

<div class="post-metadata">

**Author:** ![ajf6347](https://avatars.discourse-cdn.com/v4/letter/a/258eb7/32.png) [@ajf6347](https://community.plotly.com/u/ajf6347)\
**Post date:** [February 16, 2018, 5:25pm UTC](https://community.plotly.com/t/how-to-get-url-of-new-graph-when-its-generated/8377/3 "2018-02-16T17:25:18Z")

</div>

Works perfectly. Thank you.

- Adam
