# Carbon emissions?

**URL:** <https://community.fly.io/t/carbon-emissions/4345>\
**Category:** General\
**Created:** [March 11, 2022, 6:45am UTC](https://community.fly.io/t/carbon-emissions/4345 "2022-03-11T06:45:42Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![mrchrisadams](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/mrchrisadams/32/43002_2.png) [@mrchrisadams](https://community.fly.io/u/mrchrisadams)\
**Post date:** [April 19, 2023, 8:13am UTC](https://community.fly.io/t/carbon-emissions/4345/6 "2023-04-19T08:13:49Z")

</div>

Hey folks.

I’m coming back to this, as I’m still doing a bit of work in this field and figured others might be interested in joining in or following aling.

I mentioned before that where I work, we’ve been working on an IP to carbon intensity API now - this provided country level carbon intensity figures.

> **[IP to CO2 Intensity: Overview](https://developers.thegreenwebfoundation.org/api/ip-to-co2/overview/)**
>
> Use this API to check the carbon intensity of an IP address based on its real-world location.

This doesn’t seem to work for [Fly.io](http://Fly.io), because the IP ranges are not exposed. You can see the confirmation here:

> [@Does Fly.io publish any kind of IP-range-to-region mapping ?](https://community.fly.io/t/does-fly-io-publish-any-kind-of-ip-range-to-region-mapping/11306/3):
>
> I would also really appreciate some listing of the current outbound IPs for a given region. We are working through an issue right now where requests to Google Cloud’s APIs (ie all requests to [googleapis.com](http://googleapis.com)) are being blocked with 403 errors, but seemingly only for outbound requests from our Singapore-region fly instances. We have a high priority support ticket and are working with the Google Cloud team to try to resolve the issue, but it is hard to resolve given I cannot give them helpful dia…

I’ve realised though that because [fly.io](http://fly.io) exposes the FLY\_REGION environment variable to the application server managing a request, you can share where it is being served from.

This would let you work out the average carbon intensity of the energy being used, at country level at least. We we publish this data as part of an open source software library, CO2.js.

> **[Release guide: CO2.js v0.13 - Green Web Foundation](https://www.thegreenwebfoundation.org/news/release-guide-co2-js-v0-13-0/)**
>
> CO2.js v0.13.0 brings the latest average grid intensity data from Ember into the library, as well as expands the number of countries for which average grid intensity data is available.

This is driven by the data visible here in the app:

> <https://github.com/thegreenwebfoundation/co2.js/blob/main/data/output/average-intensities.json>

Carbon intensity varies within a country, but this would be a starting point.

I’m planning to use [fly.io](http://fly.io) for a project later this month, where I’m intending to experiment with exposing this info via headers so that users can start to understand the carbon footprint of request. I’ve outlined some more below, here:

> [@How can I tell which region a fly app is being served from?](https://community.fly.io/t/how-can-i-tell-which-region-a-fly-app-is-being-served-from/12336):
>
> hi there, When I receive a request to my application, I’d like to be able to expose the fly region I am serving the response from, and ideally figure out a way to serve the carbon intensity of the energy it’s using. So if I am in say New York, and I am running an application in Montreal, I’d want to be able to surface that it’s being served from a Montreal datacentre, where the energy has a much lower carbon intensity than than other parts of North America. (let’s put aside issues about laten…

If you’re up for experimenting in this field, let me know - I really like [Fly.io](http://Fly.io) as as platform, and I’d rather [Fly.io](http://Fly.io) becomes a greener platform than try to find a green platform, and somehow hope the developer experience eventually reaches that of [fly.io](http://fly.io).

---

_[View the full topic](https://community.fly.io/t/carbon-emissions/4345)._
