[1] Title: Carbon (API) [1] URL Source: https://en.wikipedia.org/wiki/Carbon_(API) [1] Description: Carbon was one of two primary C-based application programming interfaces (APIs) developed by Apple for the macOS (formerly Mac OS X and OS X) operating system. Carbon provided a good degree of backward compatibility for programs that ran on Mac OS 8 and 9. Developers could use the Carbon APIs ... [1] Published Time: 2002-06-14T04:36:50Z [1] Markdown Content: From Wikipedia, the free encyclopedia Carbon [Developer(s)](https://en.wikipedia.org/wiki/Programmer "Programmer") [Apple Inc.](https://en.wikipedia.org/wiki/Apple_Inc. "Apple Inc.") [Operating system](https://en.wikipedia.org/wiki/Operating_system "Operating system") [Classic Mac OS](https://en.wikipedia.org/wiki/Classic_Mac_OS "Classic Mac OS"), [macOS](https://en.wikipedia.org/wiki/MacOS "MacOS") [License](https://en.wikipedia.org/wiki/Software_license "Software license") [Proprietary](https://en.wikipedia.org/wiki/Proprietary_software "Proprietary software") **Carbon** was one of two primary [C-based](https://en.wikipedia.org/wiki/C_/(programming_language/) "C (programming language)") [application programming interfaces](https://en.wikipedia.org/wiki/Application_programming_interface "Application programming interface") (APIs) developed by [Apple](https://en.wikipedia.org/wiki/Apple_Inc. "Apple Inc.") for the [macOS](https://en.wikipedia.org/wiki/MacOS "MacOS") (formerly Mac OS X and OS X) [operating system](https://en.wikipedia.org/wiki/Operating_system "Operating system"). Carbon provided a good degree of [backward compatibility](https://en.wikipedia.org/wiki/Backward_compatibility "Backward compatibility") for [programs](https://en.wikipedia.org/wiki/Computer_program "Computer program") that ran on [Mac OS 8](https://en.wikipedia.org/wiki/Mac_OS_8 "Mac OS 8") and [9](https://en.wikipedia.org/wiki/Mac_OS_9 "Mac OS 9"). Developers could use the Carbon APIs to port (“carbonize”) their [“classic” Mac](https://en.wikipedia.org/wiki/Classic_Mac_OS "Classic Mac OS") applications and software to the Mac OS X platform with little effort, compared to [porting](https://en.wikipedia.org/wiki/Porting "Porting") the app to the entirely different [Cocoa](https://en.wikipedia.org/wiki/Cocoa_/(API/) "Cocoa (API)") system, which originated in [OPENSTEP](https://en.wikipedia.org/wiki/OPENSTEP "OPENSTEP"). With the release of [macOS 10.15 Catalina](https://en.wikipedia.org/wiki/MacOS_Catalina "MacOS Catalina"), the Carbon API was officially discontinued and removed, leaving Cocoa as the sole primary API for developing macOS applications. Carbon was an important part of Apple's strategy for bringing Mac OS X to market, offering a path for quick porting of existing software applications, as well as a means of shipping applications that would run on either Mac OS X or the classic Mac OS. As the market has increasingly moved to the Cocoa-based frameworks, especially after the release of [iOS](https://en.wikipedia.org/wiki/IOS "IOS"), the need for a porting library was reduced. Apple did not create a [64-bit](https://en.wikipedia.org/wiki/64-bit "64-bit") version of Carbon while updating their other frameworks in the 2007 time-frame, and eventually [deprecated](https://en.wikipedia.org/wiki/Deprecated "Deprecated") the entire API in [OS X 10.8 Mountain Lion](https://en.wikipedia.org/wiki/OS_X_Mountain_Lion "OS X Mountain Lion"), which was released on July 24, 2012. [![](https://upload.wikimedia.org/wikipedia/en/thumb/d/d4/Adobe_ImageReady_7.0_running_on_Mac_OS_X.png/275px-Adobe_ImageReady_7.0_running_on_Mac_OS_X.png)](https://en.wikipedia.org/wiki/File:Adobe_ImageReady_7.0_running_on_Mac_OS_X.png) "Carbonized" application [Adobe Systems](https://en.wikipedia.org/wiki/Adobe_Systems "Adobe Systems") [ImageReady](https://en.wikipedia.org/wiki/Adobe_ImageReady "Adobe ImageReady") v.7.0 running directly on [Mac OS X](https://en.wikipedia.org/wiki/MacOS "MacOS") version [10.2](https://en.wikipedia.org/wiki/Mac_OS_X_v10.2 "Mac OS X v10.2") ### Classic Mac OS programming \[[edit](https://en.wikipedia.org/w/index.php?title=Carbon_\(API\)&action=edit§ion=2 "Edit section: Classic Mac OS programming")\] The [original Mac OS](https://en.wikipedia.org/wiki/Classic_Mac_OS "Classic Mac OS") used [Pascal](https://en.wikipedia.org/wiki/Pascal_/(programming_language/) "Pascal (programming language)") as its primary development platform, and the APIs were heavily based on Pascal's [call semantics](https://en.wikipedia.org/wiki/Call_semantics "Call semantics"). Much of the [Macintosh Toolbox](https://en.wikipedia.org/wiki/Macintosh_Toolbox "Macintosh Toolbox") consisted of [procedure calls](https://en.wikipedia.org/wiki/Subroutine "Subroutine"), passing information back and forth between the API and program using a variety of [data structures](https://en.wikipedia.org/wiki/Data_structure "Data structure") based on Pascal's [variant record](https://en.wikipedia.org/wiki/Variant_record "Variant record") concept. Over time, a number of [object libraries](https://en.wikipedia.org/wiki/Object_library "Object library") evolved on the Mac, notably the [Object Pascal](https://en.wikipedia.org/wiki/Object_Pascal "Object Pascal") library [MacApp](https://en.wikipedia.org/wiki/MacApp "MacApp") and the [THINK C](https://en.wikipedia.org/wiki/THINK_C "THINK C") Think Class Library, and later versions of MacApp and [CodeWarrior](https://en.wikipedia.org/wiki/CodeWarrior "CodeWarrior")'s PowerPlant in [C++](https://en.wikipedia.org/wiki/C%2B%2B "C++"). With the purchase of [NeXT](https://en.wikipedia.org/wiki/NeXT "NeXT") in late 1996, Apple developed a new operating system strategy based largely on the existing [OPENSTEP for Mach](https://en.wikipedia.org/wiki/OpenStep#OPENSTEP_for_Mach "OpenStep") platform. The new [Rhapsody](https://en.wikipedia.org/wiki/Rhapsody_/(operating_system/) "Rhapsody (operating system)") OS strategy was relatively simple; it retained most of OpenStep's existing object libraries under the name "Yellow Box", ported the existing [GUI](https://en.wikipedia.org/wiki/GUI "GUI") in OPENSTEP for Mach and made it look more Mac-like, ported several major [APIs](https://en.wikipedia.org/wiki/API "API") from the Mac OS to Rhapsody's underlying [Unix-like](https://en.wikipedia.org/wiki/Unix-like "Unix-like") system (notably [QuickTime](https://en.wikipedia.org/wiki/QuickTime "QuickTime") and [AppleSearch](https://en.wikipedia.org/wiki/AppleSearch "AppleSearch")), and added an emulator known as the "Blue Box" that ran existing Mac OS software. When this plan was revealed at the [Worldwide Developers Conference](https://en.wikipedia.org/wiki/Worldwide_Developers_Conference "Worldwide Developers Conference") (WWDC) in 1997 there was some push-back from existing Mac OS developers who were upset that their code bases would be effectively locked into an emulator that was unlikely to ever be updated. They took to calling the Blue Box the "penalty box".\[_[citation needed](https://en.wikipedia.org/wiki/Wikipedia:Citation_needed "Wikipedia:Citation needed")_\] Larger developers like [Microsoft](https://en.wikipedia.org/wiki/Microsoft "Microsoft") and [Adobe](https://en.wikipedia.org/wiki/Adobe_Systems "Adobe Systems") balked outright, and refused to consider porting to OpenStep, which was so different from the existing Mac OS that there was little or no compatibility. Apple took these concerns to heart. When [Steve Jobs](https://en.wikipedia.org/wiki/Steve_Jobs "Steve Jobs") announced Apple's change in direction at the next WWDC in 1998, he stated that "what developers really wanted was a modern version of the Mac OS, and Apple \[was\] going to deliver it". The original Rhapsody concept, with only the Blue Box for running existing Mac OS software, was eventually released in 1999 as [Mac OS X Server 1.0](https://en.wikipedia.org/wiki/Mac_OS_X_Server_1.0 "Mac OS X Server 1.0"). This was the only release based on the original Rhapsody concept. In order to offer a real and well supported upgrade path for existing Mac OS code bases, Apple introduced the Carbon system. Carbon consists of many libraries and functions that offer a Mac-like API, but running on top of the underlying Unix-like OS, rather than a copy of the Mac OS running in emulation. The Carbon libraries are extensively cleaned up, modernized and better "protected". While the Mac OS was filled with APIs that shared memory to pass data, under Carbon all such access was re-implemented using [accessor](https://en.wikipedia.org/wiki/Mutator_method "Mutator method") [subroutines](https://en.wikipedia.org/wiki/Subroutine "Subroutine") on [opaque data types](https://en.wikipedia.org/wiki/Opaque_data_type "Opaque data type"). This allowed Carbon to support true [multitasking](https://en.wikipedia.org/wiki/Computer_multitasking "Computer multitasking") and [memory protection](https://en.wikipedia.org/wiki/Memory_protection "Memory protection"), features Mac developers had been requesting for a decade. Other changes from the pre-existing API removed features which were conceptually incompatible with Mac OS X, or simply obsolete. For example, applications could no longer install [interrupt handlers](https://en.wikipedia.org/wiki/Interrupt_handler "Interrupt handler") or [device drivers](https://en.wikipedia.org/wiki/Device_driver "Device driver"). In order to support Carbon, the entire Rhapsody model changed. Whereas Rhapsody would effectively be OpenStep with an emulator, under the new system both the OpenStep and Carbon API would, where possible, share common code. To do this, many of the useful bits of code from the lower-levels of the OpenStep system, written in Objective-C and known as Foundation, were re-implemented in pure C. This code became known as [Core Foundation](https://en.wikipedia.org/wiki/Core_Foundation "Core Foundation"), or CF for short. A version of the Yellow Box ported to call CF became the new [Cocoa](https://en.wikipedia.org/wiki/Cocoa_/(API/) "Cocoa (API)") API, and the Mac-like calls of Carbon also called the same functions. Under the new system, Carbon and Cocoa were peers. This conversion would normally have slowed the performance of Cocoa as the object methods called into the underlying C libraries, but Apple used a technique they called _toll-free [bridging](https://en.wikipedia.org/wiki/Bridging_/(programming/) "Bridging (programming)")_ to reduce this impact.[\[1\]](https://en.wikipedia.org/wiki/Carbon_(API)#cite_note-1) As part of this conversion, Apple also ported the [graphics engine](https://en.wikipedia.org/wiki/2D_computer_graphics "2D computer graphics") from the licence-encumbered [Display PostScript](https://en.wikipedia.org/wiki/Display_PostScript "Display PostScript") to the licence-free [Quartz](https://en.wikipedia.org/wiki/Quartz_/(graphics_layer/) "Quartz (graphics layer)") (which has been called "Display PDF").[\[2\]](https://en.wikipedia.org/wiki/Carbon_(API)#cite_note-2) Quartz provided native calls that could be used from either Carbon or Cocoa, as well as offering [Java 2D](https://en.wikipedia.org/wiki/Java_2D "Java 2D")\-like interfaces as well. The underlying operating system itself was further isolated and released as [Darwin](https://en.wikipedia.org/wiki/Darwin_/(operating_system/) "Darwin (operating system)"). ### Release and evolution \[[edit](https://en.wikipedia.org/w/index.php?title=Carbon_\(API\)&action=edit§ion=5 "Edit section: Release and evolution")\] Carbon was introduced in incomplete form in 2000, as a shared library backward-compatible with 1997's Mac OS 8.1. This version allowed developers to port their code to Carbon without losing the ability for those programs to run on existing Mac OS machines. Porting to Carbon became known as "Carbonization". Official Mac OS X support arrived in 2001 with the release of [Mac OS X v10.0](https://en.wikipedia.org/wiki/Mac_OS_X_v10.0 "Mac OS X v10.0"), the first public version of the new OS. Carbon was very widely used in early versions of Mac OS X by almost all major software houses, even by Apple. The [Finder](https://en.wikipedia.org/wiki/Finder_/(software/) "Finder (software)"), for instance, remained a Carbon application for many years, only being ported to Cocoa with the release of Mac OS X 10.6 in 2009.[\[3\]](https://en.wikipedia.org/wiki/Carbon_(API)#cite_note-3) The transition to [64-bit](https://en.wikipedia.org/wiki/64-bit_computing "64-bit computing") Macintosh applications beginning with [Mac OS X v10.5](https://en.wikipedia.org/wiki/Mac_OS_X_Leopard "Mac OS X Leopard"), released October 26, 2007, brought the first major limitations to Carbon. Apple does not provide compatibility between the Macintosh [graphical user interface](https://en.wikipedia.org/wiki/Graphical_user_interface "Graphical user interface") and the C programming language in the 64-bit environment, instead requiring the use of the [Objective-C](https://en.wikipedia.org/wiki/Objective-C "Objective-C") dialect with the Cocoa API.[\[4\]](https://en.wikipedia.org/wiki/Carbon_(API)#cite_note-4) Many commentaries took this to be the first sign of Carbon's eventual disappearance, a position that was re-enforced when Apple stated no new major additions would be added to the Carbon system,[\[5\]](https://en.wikipedia.org/wiki/Carbon_(API)#cite_note-5)[\[6\]](https://en.wikipedia.org/wiki/Carbon_(API)#cite_note-6) and further reinforced with its deprecation in 2012. ### Transition to Cocoa \[[edit](https://en.wikipedia.org/w/index.php?title=Carbon_\(API\)&action=edit§ion=6 "Edit section: Transition to Cocoa")\] Despite the purported advantages of Cocoa, the need to rewrite large amounts of legacy code slowed the transition of Carbon-based applications, famously with [Adobe Photoshop](https://en.wikipedia.org/wiki/Adobe_Photoshop "Adobe Photoshop"),[\[7\]](https://en.wikipedia.org/wiki/Carbon_(API)#cite_note-7) which was eventually updated to Cocoa in April 2010. This also extended to Apple's own flagship software packages, as [iTunes](https://en.wikipedia.org/wiki/ITunes "ITunes")[\[8\]](https://en.wikipedia.org/wiki/Carbon_(API)#cite_note-8) and [Final Cut Pro](https://en.wikipedia.org/wiki/Final_Cut_Pro "Final Cut Pro") (as well as the features in the [QuickTime](https://en.wikipedia.org/wiki/QuickTime "QuickTime") engine that powers it[\[9\]](https://en.wikipedia.org/wiki/Carbon_(API)#cite_note-9)) remained written in Carbon for many years. Both iTunes and Final Cut Pro X have since been released in Cocoa versions. ### Deprecation and discontinuation \[[edit](https://en.wikipedia.org/w/index.php?title=Carbon_\(API\)&action=edit§ion=7 "Edit section: Deprecation and discontinuation")\] In 2012, with the release of OS X 10.8 Mountain Lion, most Carbon APIs were considered deprecated. The APIs were still accessible to developers and all Carbon applications still ran, but the APIs would no longer be updated. On June 28, 2017, Apple announced that 32-bit software for macOS, such as all Carbon applications, would no longer be supported “without compromise” on versions of macOS after [macOS 10.13 High Sierra](https://en.wikipedia.org/wiki/MacOS_High_Sierra "MacOS High Sierra").[\[10\]](https://en.wikipedia.org/wiki/Carbon_(API)#cite_note-10) [macOS 10.15 Catalina](https://en.wikipedia.org/wiki/MacOS_Catalina "MacOS Catalina") officially removed support for 32-bit applications, including all Carbon applications.[\[11\]](https://en.wikipedia.org/wiki/Carbon_(API)#cite_note-11) Carbon descends from the [Toolbox](https://en.wikipedia.org/wiki/Macintosh_Toolbox "Macintosh Toolbox"), and as such, is composed of "Managers". Each Manager is a functionally related API, defining sets of data structures and functions to manipulate them. Managers are often interdependent or layered. Carbon consists of a broad set of functions for managing files, memory, data, the user interface, and other system services. It is implemented as any other API: in macOS, it is spread over several frameworks (each a structure built around a [shared library](https://en.wikipedia.org/wiki/Library_/(computing/) "Library (computing)")), principally `Carbon.framework`, `ApplicationServices.framework`, and `CoreServices.framework`, and in classic Mac OS, it resides in a single shared library named `**CarbonLib**`. As an [umbrella term](https://en.wikipedia.org/wiki/Umbrella_term "Umbrella term") encompassing all C-language API procedures accessing Mac-specific functionality, Carbon is not designed as a discrete system. Rather, it opens nearly all the functionality of macOS to developers who do not know the [Objective-C](https://en.wikipedia.org/wiki/Objective-C "Objective-C") language required for the broadly equivalent [Cocoa API](https://en.wikipedia.org/wiki/Cocoa_/(API/) "Cocoa (API)").[\[12\]](https://en.wikipedia.org/wiki/Carbon_(API)#cite_note-12) Carbon is compatible with all of the several [executable formats](https://en.wikipedia.org/wiki/Object_file "Object file") available for PowerPC Mac OS. Binary compatibility between Mac OS X and previous versions requires use of a [Preferred Executable Format](https://en.wikipedia.org/wiki/Preferred_Executable_Format "Preferred Executable Format") file, which Apple never supported in their [Xcode](https://en.wikipedia.org/wiki/Xcode "Xcode") [IDE](https://en.wikipedia.org/wiki/Integrated_development_environment "Integrated development environment"). Newer parts of Carbon tend to be much more object-oriented in their conception, most of them based on [Core Foundation](https://en.wikipedia.org/wiki/Core_Foundation "Core Foundation"). Some Managers, such as the HIView Manager (a superset of the Control Manager), are implemented in [C++](https://en.wikipedia.org/wiki/C%2B%2B "C++"), but Carbon remains a [C](https://en.wikipedia.org/wiki/C_/(programming_language/) "C (programming language)") API. Some examples of Carbon Managers: * File Manager — manages access to the file system, opening, closing, reading and writing files. * Resource Manager — manages access to resources, which are predefined chunks of data a program may require. Calls File Manager to read and write resources from disk files. Examples of resources include icons, sounds, images, templates for widgets, etc. * Font Manager — manages [fonts](https://en.wikipedia.org/wiki/Typeface "Typeface"). Deprecated (as part of [QuickDraw](https://en.wikipedia.org/wiki/QuickDraw "QuickDraw")) since [Mac OS X v10.4](https://en.wikipedia.org/wiki/Mac_OS_X_Tiger "Mac OS X Tiger"), in favor of [Apple Type Services](https://en.wikipedia.org/wiki/Apple_Type_Services "Apple Type Services") (ATS). * [QuickDraw](https://en.wikipedia.org/wiki/QuickDraw "QuickDraw") — 2D graphics primitives. Deprecated since [Mac OS X v10.4](https://en.wikipedia.org/wiki/Mac_OS_X_Tiger "Mac OS X Tiger"), in favor of Quartz 2D. * Carbon Event Manager — converts user and system activity into events that code can recognise and respond to. * HIObject — a completely new object-oriented API which brings to Carbon an [OO](https://en.wikipedia.org/wiki/Object-oriented_programming "Object-oriented programming") model for building GUIs. HIToolbox in Mac OS Classic and [Copland](https://en.wikipedia.org/wiki/Copland_/(operating_system/) "Copland (operating system)")[\[13\]](https://en.wikipedia.org/wiki/Carbon_(API)#cite_note-13) relied on abandoned [IBM System Object Model](https://en.wikipedia.org/wiki/IBM_System_Object_Model "IBM System Object Model"), so Carbon had to provide quick-and-dirty replacement to enable porting of legacy code. This is available in [Mac OS X v10.2](https://en.wikipedia.org/wiki/Mac_OS_X_v10.2 "Mac OS X v10.2") or later, and gives Carbon programmers some of the tools that Cocoa developers have long been familiar with. Starting with [Mac OS X v10.2](https://en.wikipedia.org/wiki/Mac_OS_X_v10.2 "Mac OS X v10.2"), HIObject is the base class for all GUI elements in Carbon. HIView is supported by [Interface Builder](https://en.wikipedia.org/wiki/Interface_Builder "Interface Builder"), part of Apple's developer tools. Traditionally GUI architectures of this sort have been left to third-party application frameworks to provide. Starting with Mac OS X v10.4, HIObjects are NSObjects and inherit the ability to be serialized into data streams for transport or saving to disk. * HITheme — uses QuickDraw and Quartz to render [graphical user interface](https://en.wikipedia.org/wiki/Graphical_user_interface "Graphical user interface") (GUI) elements to the screen. HITheme was introduced in [Mac OS X v10.3](https://en.wikipedia.org/wiki/Mac_OS_X_v10.3 "Mac OS X v10.3"), and Appearance Manager is a compatibility layer on top of HITheme since that version. * HIView Manager — manages creation, drawing, [hit-testing](https://en.wikipedia.org/wiki/Hit-testing "Hit-testing"), and manipulation of controls. Since Mac OS X v10.2, all controls are HIViews. In Mac OS X v10.4, the Control Manager was renamed HIView Manager. * Window Manager — manages creation, positioning, updating, and manipulation of windows. Since Mac OS X v10.2, windows have a root HIView. * Menu Manager — manages creation, selection, and manipulation of menus. Since Mac OS X v10.2, menus are HIObjects. Since Mac OS X v10.3, menu content may be drawn using HIViews, and all standard menus use HIViews to draw. The Mac Toolbox's Event Manager originally used a [polling](https://en.wikipedia.org/wiki/Polling_/(computer_science/) "Polling (computer science)") model for application design. The application's main [event loop](https://en.wikipedia.org/wiki/Event_loop "Event loop") asks the Event Manager for an event using GetNextEvent. If there is an event in the queue, the Event Manager passes it back to the application, where it is handled, otherwise it returns immediately. This behavior is called "[busy-waiting](https://en.wikipedia.org/wiki/Busy_waiting "Busy waiting")", running the event loop unnecessarily. Busy-waiting reduces the amount of CPU time available for other applications and decreases battery power on laptops. The classic Event Manager dates from the original Mac OS in 1984, when whatever application was running was guaranteed to be the _only_ application running, and where power management was not a concern. With the advent of MultiFinder and the ability to run more than one application simultaneously came a new Event Manager call, _WaitNextEvent_, which allows an application to specify a sleep interval. One easy trick for legacy code to adopt a more efficient model without major changes to its source code is simply to set the sleep parameter passed to _WaitNextEvent_ to a very large value—on macOS, this puts the thread to sleep whenever there is nothing to do, and only returns an event when there is one to process. In this way, the polling model is quickly inverted to become equivalent to the callback model, with the application performing its own event dispatching in the original manner. There are loopholes, though. For one, the legacy toolbox call _ModalDialog_, for example, calls the older _GetNextEvent_ function internally, resulting in polling in a tight loop without blocking. Carbon introduces a replacement system, called the Carbon Event Manager. (The original Event Manager still exists for compatibility with legacy applications). Carbon Event Manager provides the event loop for the developer (based on Core Foundation's `CFRunLoop` in the current implementation); the developer sets up event handlers and enters the event loop in the main function, and waits for Carbon Event Manager to dispatch events to the application. In the classic Mac OS, there was no operating system support for application level timers (the lower level Time Manager was available, but it executed timer callbacks at interrupt time, during which calls could not be safely made to most Toolbox routines). Timers were usually left to application developers to implement, and this was usually done by counting elapsed time during the _idle_ event - that is, an event that was returned by _WaitNextEvent_ when any other event wasn't available. In order for such timers to have reasonable resolution, developers could not afford _WaitNextEvent_ to delay too long, and so low "sleep" parameters were usually set. This results in highly inefficient scheduling behavior, since the thread will not sleep for very long, instead repeatedly waking to return these idle events. Apple added timer support to Carbon to address this problem—the system can schedule timers with great efficiency. Open source implementations --------------------------- \[[edit](https://en.wikipedia.org/w/index.php?title=Carbon_\(API\)&action=edit§ion=11 "Edit section: Open source implementations")\] [GNUstep](https://en.wikipedia.org/wiki/GNUstep "GNUstep") contains an implementation of the Carbon API called Boron. It aims to be compatible with non-deprecated parts of ApplicationServices and CoreServices. The name derives the fact that [Boron](https://en.wikipedia.org/wiki/Boron "Boron") comes before Carbon on the [periodic table of elements](https://en.wikipedia.org/wiki/Periodic_table_of_elements "Periodic table of elements").[\[14\]](https://en.wikipedia.org/wiki/Carbon_(API)#cite_note-14) [Darling](https://en.wikipedia.org/wiki/Darling_/(software/) "Darling (software)") also contains a Carbon implementation. Both implementations are highly incomplete and consist mostly of stub functions. * [Cocoa](https://en.wikipedia.org/wiki/Cocoa_/(API/) "Cocoa (API)") * [Interface Builder](https://en.wikipedia.org/wiki/Interface_Builder "Interface Builder") * [Objective-C](https://en.wikipedia.org/wiki/Objective-C "Objective-C") * [Xcode](https://en.wikipedia.org/wiki/Xcode "Xcode") 1. **[^](https://en.wikipedia.org/wiki/Carbon_(API)#cite_ref-1 "Jump up")** ["Concepts in Objective-C Programming: Toll-Free Bridging"](https://developer.apple.com/library/content/documentation/General/Conceptual/CocoaEncyclopedia/Toll-FreeBridgin/Toll-FreeBridgin.html). _developer.apple.com_. 2012. Retrieved May 8, 2017. 2. **[^](https://en.wikipedia.org/wiki/Carbon_(API)#cite_ref-2 "Jump up")** Siracusa, John (2000). ["Mac OS X Update: Quartz & Aqua"](http://archive.arstechnica.com/reviews/1q00/macos-x-gui/macos-x-gui-4.html). _archive.arstechnica.com_. Retrieved May 8, 2017. 3. **[^](https://en.wikipedia.org/wiki/Carbon_(API)#cite_ref-3 "Jump up")** Krazit, Tom (October 17, 2008). ["Apple moving Finder to Cocoa"](https://web.archive.org/web/20150711154619/http://www.cnet.com/uk/news/apple-moving-finder-to-cocoa/). _[CNET](https://en.wikipedia.org/wiki/CNET "CNET")_. Archived from [the original](https://www.cnet.com/uk/news/apple-moving-finder-to-cocoa/) on July 11, 2015. Retrieved May 21, 2015. 4. **[^](https://en.wikipedia.org/wiki/Carbon_(API)#cite_ref-4 "Jump up")** Apple Inc. ["Introduction to 64-Bit Guide for Carbon Developers"](https://web.archive.org/web/20090611041727/http://developer.apple.com/documentation/Carbon/Conceptual/Carbon64BitGuide/Introduction/Introduction.html). Archived from [the original](https://developer.apple.com/documentation/Carbon/Conceptual/Carbon64BitGuide/Introduction/Introduction.html) on June 11, 2009. 5. **[^](https://en.wikipedia.org/wiki/Carbon_(API)#cite_ref-5 "Jump up")** Apple Inc. ["Choosing a Development Path for Your Carbon User Interface"](https://web.archive.org/web/20090804014545/http://developer.apple.com/documentation/Carbon/Conceptual/Carbon64BitGuide/PortingTo64Bit/PortingTo64Bit.html). _Modifying Your Application to Use 64-Bit Addressing_. Archived from [the original](https://developer.apple.com/documentation/Carbon/Conceptual/Carbon64BitGuide/PortingTo64Bit/PortingTo64Bit.html#//apple_ref/doc/uid/TP40004381-CH3-SW2) on August 4, 2009. 6. **[^](https://en.wikipedia.org/wiki/Carbon_(API)#cite_ref-6 "Jump up")** Siracusa, John (April 3, 2008). ["Rhapsody and blues"](https://arstechnica.com/staff/2008/04/rhapsody-and-blues/). _Ars Technica_. Retrieved February 5, 2023. 7. **[^](https://en.wikipedia.org/wiki/Carbon_(API)#cite_ref-7 "Jump up")** John Nack. ["Photoshop, Lightroom, and Adobe's 64-bit roadmap"](https://web.archive.org/web/20150414030843/http://blogs.adobe.com/jnack/2008/04/photoshop_lightroom_and_adobes_64-bit_road.html). Archived from [the original](http://blogs.adobe.com/jnack/2008/04/photoshop_lightroom_and_adobes_64-bit_road.html) on April 14, 2015. 8. **[^](https://en.wikipedia.org/wiki/Carbon_(API)#cite_ref-8 "Jump up")** Chris Foresman (September 3, 2010). ["iTunes 10 hands-on: snappier performance, questionable UI choices"](https://web.archive.org/web/20150402183024/http://arstechnica.com/apple/2010/09/itunes-10-hands-on-snappier-performance-questionable-ui-choices/). Archived from [the original](https://arstechnica.com/apple/news/2010/09/itunes-10-hands-on-snappier-performance-questionable-ui-choices.ars) on April 2, 2015. 9. **[^](https://en.wikipedia.org/wiki/Carbon_(API)#cite_ref-9 "Jump up")** John Siracusa (September 2009). ["Mac OS X 10.6 Snow Leopard: the Ars Technica review"](https://web.archive.org/web/20140713115247/http://arstechnica.com/apple/2009/08/mac-os-x-10-6/). Archived from [the original](https://arstechnica.com/apple/reviews/2009/08/mac-os-x-10-6.ars) on July 13, 2014. 10. **[^](https://en.wikipedia.org/wiki/Carbon_(API)#cite_ref-10 "Jump up")** [Apple Inc.](https://en.wikipedia.org/wiki/Apple_Inc. "Apple Inc.") (June 28, 2017). ["64-bit Requirement for Mac Apps"](https://web.archive.org/web/20180130123005/https://developer.apple.com/news/?id=06282017a). Archived from [the original](https://developer.apple.com/news/?id=06282017a) on January 30, 2018. Retrieved February 18, 2018. 11. **[^](https://en.wikipedia.org/wiki/Carbon_(API)#cite_ref-11 "Jump up")** MacRumors (June 4, 2019). ["32-Bit Apps 'Not Optimized for Your Mac' to Stop Working on macOS Catalina"](https://www.macrumors.com/guide/32-bit-mac-apps/). Retrieved August 10, 2019. 12. **[^](https://en.wikipedia.org/wiki/Carbon_(API)#cite_ref-12 "Jump up")** Apple Inc. ["Apple Carbon homepage"](https://web.archive.org/web/20121012135554/https://developer.apple.com/carbon/). Archived from [the original](https://developer.apple.com/Carbon/) on October 12, 2012. 13. **[^](https://en.wikipedia.org/wiki/Carbon_(API)#cite_ref-13 "Jump up")** [HIEditText SOM class description from Mac OS 8.0 (Copland) DDK](http://octagram.name/pub/somobjects/copland/copland_d11e4_jun_1996_mac_os_8_ddk_0.4_original_cd_image/Mac%20OS%208%20Dev.%20Env.%20SW/Interfaces/IDLIncludes/HIEditText.idl)\[_[permanent dead link](https://en.wikipedia.org/wiki/Wikipedia:Link_rot "Wikipedia:Link rot")_\] 14. **[^](https://en.wikipedia.org/wiki/Carbon_(API)#cite_ref-14 "Jump up")** ["gnustep/libs-boron: Boron is the atom that comes before carbon"](https://github.com/gnustep/libs-boron). _GitHub_. GNUstep. March 23, 2019. * [Carbon Reference Library (Apple Developer Connection)](https://web.archive.org/web/20090420064147/http://developer.apple.com/referencelibrary/Carbon/) at the [Wayback Machine](https://en.wikipedia.org/wiki/Wayback_Machine "Wayback Machine") (archived April 20, 2009) [2] Title: Homepage - Cloverly [2] URL Source: https://cloverly.com/ [2] Description: Cloverly empowers both the businesses that buy and the businesses that supply carbon removals and credits by providing trust, access, and ease to scale meaningful impact. [2] Markdown Content: Platform For Scaling Climate Action ----------------------------------- Cloverly is the digital infrastructure that empowers businesses to scale their climate action now. Power the Ecosystem, Scale The Impact ------------------------------------- Cloverly empowers both the businesses that buy and the businesses that supply carbon removals and credits by providing trust, access, and ease to scale meaningful impact. ![Image 1](blob:https://cloverly.com/ef1d029dc8861b05f2783250c23fc61e) ### **“The deployment of carbon dioxide removal (CDR) to counterbalance hard-to-abate residual emissions is unavoidable if net zero CO2 or GHG emissions are to be achieved.”** **– IPCC’s Mitigation of Climate Change Report** ![Image 2](blob:https://cloverly.com/1e4f3e66c4cb1600be14d5dec524bfd9) How Cloverly Empowers Businesses to Rapidly Scale Climate Action ---------------------------------------------------------------- ### Trust We enable meaningful climate action through transparency, integrity, and partnership. ### Access We remove the friction between supply and demand to accelerate critical action. ### Ease We drive large-scale impact through powerful technology, data, and an ability to rapidly scale and innovate through a single partner. Trusted by many of the world’s leading companies to power their climate action goals ------------------------------------------------------------------------------------ Solution Overview for Buyers and Suppliers ------------------------------------------ ![Image 3](blob:https://cloverly.com/3139dc70bae0236bc63031fb376c3e2d) ### Cloverly Empowers Buyers Cloverly enables buyers to take immediate action toward reaching climate goals through a comprehensive platform of technology and direct carbon credit purchasing solutions. ### Cloverly Empowers Suppliers By providing distribution and software solutions designed to help carbon credit suppliers manage operations, Cloverly delivers the support suppliers need to scale. ![Image 4](blob:https://cloverly.com/3139dc70bae0236bc63031fb376c3e2d) ![Image 5](blob:https://cloverly.com/eb790dea360cff22a84663d911a8ad24) ### Scale Your Carbon Credit Business with Catalyst Cloverly Catalyst is the hub for your carbon credit business. Manage the entire lifecycle of your credits through inventory management, omnichannel distribution, insightful reporting and more. Projects Backed By Integrity ---------------------------- The Cloverly Marketplace℠ is a global collection of carbon removal and other high-quality projects vetted by in-house climate experts. Featured Insights ----------------- ![Image 6](blob:https://cloverly.com/320d93f6fbd892c497c063994371f2e0) ### News Cloverly Announces $19M Series A Funding Round and Validation of the… **[Read More](https://cloverly.com/resources/)** ![Image 7](blob:https://cloverly.com/320d93f6fbd892c497c063994371f2e0) ### White Paper Beginner’s Guide to Carbon Credits **[Read More](https://cloverly.com/beginner-guide-to-carbon-credits-white-paper/)** ![Image 8](blob:https://cloverly.com/320d93f6fbd892c497c063994371f2e0) ### Blog Carbon Removal In The Voluntary Carbon Market: Scaling Climate Action **[Read More](https://cloverly.com/carbon-removal-in-the-voluntary-carbon-market-scaling-climate-action/)** Scale Your Impact ----------------- ### Subscribe [3] Title: Server Error in '/' Application. [3] URL Source: https://www.api.org/climate [3] Description: The U.S. natural gas and oil industry is working to address the risks of climate change and build a lower-carbon future. Learn how we're striving to create a cleaner tomorrow while meeting the world’s growing need for affordable, reliable energy. [3] Markdown Content: _Runtime Error_ --------------- **Description:** An exception occurred while processing your request. Additionally, another exception occurred while executing the custom error page for the first exception. The request has been terminated. [4] Title: Exploring the Green APIs [4] URL Source: https://www.wonderingchimp.com/exploring-the-green-apis/ [4] Description: Have you ever wondered, is there an API you can call and get the carbon emission data of a specific location? It would be cool to have something like this, so we can make our applications carbon-aware, wouldn't it? Look no further! In this article I'm exploring just that! [4] Published Time: 2023-11-13T12:01:51.000Z [4] Markdown Content: [sustainability](https://www.wonderingchimp.com/tag/sustainability/)Have you ever wondered, is there an API you can call and get the carbon emission data of a specific location? It would be cool to have something like this, so we can make our applications carbon-aware, wouldn't it? Look no further! In this article I'm exploring just that! [![Image 1: Marjan Bugarinović](https://www.wonderingchimp.com/content/images/size/w160/2023/12/logo-green-1.png)](https://www.wonderingchimp.com/author/marjan/) Nov 13, 2023 — 10 min read Hi there! This week, we're exploring Green APIs. APIs that show you carbon intensity data you can use in your code. And based on that data create some logic. For example: * If users' location has high carbon intensity, don't load carbon intensive content on a webpage. Carbon intensive content - videos or images, for example. * If carbon intensity in a region is high, you can automatically shift your workloads into a green one. * Schedule batch jobs of your application when the carbon intensity is lower. In this article, we'll go through two of them. First, I'll write a short overview about each. Then, I'll create a small Go application we can use to call these APIs. And last we'll see the methodologies used within both of them. That's the plan. Will I be able to stick to it? Let's dive and see. Electricity Maps ---------------- First in line is the Electricity Maps. They provide electricity data for more than 160 regions. Founded in 2016 with a goal to get us to a decarbonized electricity system. You can find more about them on their website linked below. [Electricity Maps | Reduce carbon emissions with actionable electricity data Electricity Maps provides actionable electricity carbon data. We help companies effectively reduce their emissions, while differentiating their offerings. ![Image 2](https://assets-global.website-files.com/63c7ac359aace771742ca44e/63c7ac359aace72c8b2ca4a6_emap-favicon.png)© Copyright 2022 Electricity Maps ApS - Univate, Njalsgade 76, 2300 Copenhagen | CVR: DK-39101211. All Rights Reserved. ![Image 3](https://assets-global.website-files.com/63c7ac359aace771742ca44e/6536634597f32ae60046f965_electricitymaps_open-graph.jpg)](https://www.electricitymaps.com/?ref=wonderingchimp.com) They are the people behind the electricity map I have mentioned in the previous posts. And they are doing a great job! ![Image 4: This is an interactive world map on a dark background, displaying electricity consumption by country. The countries are color-coded from green to red, with green indicating low electricity consumption and red indicating high electricity consumption. The map uses a Mercator projection and includes a legend on the left side and various options on the right side.](https://www.wonderingchimp.com/content/images/2023/11/0048-electricity-maps.png) Source: [https://app.electricitymaps.com/map](https://app.electricitymaps.com/map?ref=wonderingchimp.com) Let's see what do they offer. Checking their website, they have free and paid plans. Based on the option you choose, different features are available. They offer free-tier API calls (up to 100,000), and paid options. I am going to look into the free-tier. On the type of data they are offering, you have two options: 1. Use APIs to make applications carbon-aware 2. Granular carbon accounting With the first option, they provide data based on which you can create logic in your app. You call the API, you get a JSON response. The second option focuses on carbon accounting and creating reports on the scope 2 emissions. Data includes consumption-based emissions factors from both direct operations and life cycle analysis (LCA) for the years 2021-2022. Here, we'll use the first option, and the _Free_ subscription for that option. I want to play around and test the APIs available in the free tier. Maybe I'll use it in future to make my website carbon-aware. Who knows... ### Testing out the APIs After selecting the _Free_ option, I easily log in by providing e-mail, name, last name, password... You know the drill. When I filled this information in, I am redirected to their _API Portal_. The screenshot of the portal is below. ![Image 5: This is a screenshot of the welcome page for the Electricity Maps API. The page has a white background with black text, a header that reads ‘Welcome to Electricity Maps API!’, and a paragraph explaining the API’s functionality. There’s a sidebar on the left with links to different sections of the API, and a world map in the bottom right corner. The page provides data on electricity demand across continents and more than 160 regions, and offers ways to assess individual electricity footprints and increase renewable energy use.](https://www.wonderingchimp.com/content/images/2023/11/0048-em-api-portal.png) Source: [https://api-portal.electricitymaps.com/home](https://api-portal.electricitymaps.com/home?ref=wonderingchimp.com) And this portal has everything you need! It has extensive documentation, list of available APIs with example code snippets. You can use those snippets in your app rather easy. Which as it turns out, will be quite useful for this article! Below is the example application written in Go. It shows you latest carbon intensity per specified zone. I've specified `RS` zone for the country where I live in. I've also omitted the `auth-token` which is a way to authenticate with the API. ``` package main import ( "fmt" "io/ioutil" "net/http" "encoding/json" "bytes" ) func main() { url := "https://api-access.electricitymaps.com/free-tier/carbon-intensity/latest?zone=RS" req, _ := http.NewRequest("GET", url, nil) // here you need to change YOUR_AUTH_TOKEN with the token from your registered profile req.Header.Add("auth-token", "YOUR_AUTH_TOKEN") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(jsonPrettyPrint(string(body))) } // jsonPrettyPrint() takes the JSON string and formats it to a readable format func jsonPrettyPrint(in string) string { var out bytes.Buffer err := json.Indent(&out, []byte(in), "", "\t") if err != nil { return in } return out.String() } ``` The output data is shown below. ``` { "zone": "RS", "carbonIntensity": 510, "datetime": "2023-11-10T07:00:00.000Z", "updatedAt": "2023-11-10T06:45:48.660Z", "createdAt": "2023-11-07T07:47:23.027Z", "emissionFactorType": "lifecycle", "isEstimated": true, "estimationMethod": "TIME_SLICER_AVERAGE" } ``` Here you can see the time when I've queried the API, and the carbon intensity. The value is in grams of CO2 equivalence per kWh, or **gCO2eq/kWh**. You also have the emission factor type, and the estimation method. Both of which we'll explain in the next section. I was able to create this example in a couple of minutes after logging. Without using any AI prompts. Just by following examples and instructions clearly written and stated on the portal. That is how it should be! ### Methodology Now, what about the data provided by the _Electricity Maps_, where is it from? How do they calculate the carbon intensity? The data comes from a variety of public data sources. Those sources can be transmission system operators, balancing entities, or market operators. The [complete list of data sources](https://github.com/electricitymaps/electricitymaps-contrib/blob/master/DATA_SOURCES.md?ref=wonderingchimp.com) shows where the data is sourced from. If I go a step further and check out the data source for Serbia, it shows the _ENTSOE_. I don't know what this means, so I'll dig deeper. The _ENTSOE_ stands for _European Network of Transmission System Operators for Electricity_. It represents 39 electricity TSOs (Transmission System Operators) from 35 countries across Europe. It is established to promote closer cooperation of the TSOs across Europe. To support the implementation of EU energy policy, and achieve Europe's energy and climate policy objectives. This organization publishes an [Implementation Guide](https://transparency.entsoe.eu/content/static_content/download?path=%2FStatic+content%2Fweb+api%2FRestfulAPI_IG.pdf&ref=wonderingchimp.com) for the transparent data extraction process. Thanks, [Wikipedia](https://en.wikipedia.org/wiki/European_Network_of_Transmission_System_Operators_for_Electricity?ref=wonderingchimp.com)! The data the _Electricity Maps_ gets is then processed and formatted with different parsers in a uniform way. The formatted data is then saved in the db and processed using the flow-tracing algorithm. The flow-tracing algorithm follows the _flow_ (whether it’s power, data, or something else) through a system to understand how it operates or to identify specific characteristics. It’s like a roadmap that shows you how to get from point A to point B, and all the stops you make along the way. The `ENTSOE.py` parser, used for Serbia and other _ENTSOE_ members, can be found on the link below. All parsers are open-source, and the contribution is more than welcome! Pretty neat, isn't it! [electricitymaps-contrib/parsers/ENTSOE.py at master · electricitymaps/electricitymaps-contrib A real-time visualisation of the CO2 emissions of electricity consumption - electricitymaps/electricitymaps-contrib ![Image 6](https://github.githubassets.com/assets/pinned-octocat-093da3e6fa40.svg)GitHubelectricitymaps ![Image 7](https://repository-images.githubusercontent.com/59370571/6b44b8d7-955b-44ac-abf0-18ff26090e6e)](https://github.com/electricitymaps/electricitymaps-contrib/blob/master/parsers/ENTSOE.py?ref=wonderingchimp.com) Calculation of carbon intensity is done by multiplying the power production from each source by the corresponding emission factors. The emission factors depend on different parameters. These parameters can be production source, the region and many others. Data is calculated with a number of regional and global emission factors. The table below shows the default Life-cycle emission factors. ![Image 8: This is a table displaying the emission factors for different types of energy sources. The table has three columns: ‘Mode’, ‘Emission factor (gCO2eq/kWh)’, and ‘Category’. It lists various modes such as biomass, battery discharge, coal, and gas, along with their corresponding emission factors and categories. The emission factors range from 11 (for wind) to 820 (for coal), and the categories include ‘Renewable’, ‘Fossil’, ‘Low-carbon’, ‘UK Parliamentary Office of Science and Technology’, and ‘Assumes (coal, gas, oil)’.](https://www.wonderingchimp.com/content/images/2023/11/0048-em-emission-factors.png) Source: [https://github.com/electricitymaps/electricitymaps-contrib/wiki/Default-emission-factors](https://github.com/electricitymaps/electricitymaps-contrib/wiki/Default-emission-factors?ref=wonderingchimp.com) Some part of the methodology used is published on the _Electricity Maps_ [GitHub Wiki](https://github.com/electricityMaps/electricitymaps-contrib/wiki?ref=wonderingchimp.com), and their [Blog](https://www.electricitymaps.com/blog?ref=wonderingchimp.com). Feel free to check them out for more information and reference. WattTime API ------------ The second API that I'm going to explore is the WattTime. It is a nonprofit that offers technology solutions that help in achieving emissions reductions. The nonprofit was founded in 2014, first tried on hackathon in 2013! Similar to the _Electricity Maps_, _WattTime_ provides the electricity data for many regions across the world. To find out more, check out their website linked below. ([https://www.watttime.org/](https://www.watttime.org/?ref=wonderingchimp.com)). The _WattTime_ has, as well, an excellent documentation of the API. By default, they offer a free plan, which is nice. But, it's a rather limited one. You can access and query only one region/zone. All others are forbidden. Like _Electricity Maps_, they offer paid plans, but, the price is not published. You need to e-mail them for paid plans. Anyhow, the registration and the login process is done via API. They offer comprehensive Python scripts/snippets on how to register, and perform login. I'm going to use Golang in my use-case. And I'll register for the free plan. ### Testing out the API First, let's register by running the below code. ``` package main import ( "bytes" "encoding/json" "fmt" "log" "net/http" ) func main() { // add your USERNAME and PASSWORD values := map[string]string{ "username": "USERNAME", "password": "PASSWORD", "email": "wondering.chimp@tuta.io", "org": "Wondering Chimp", } json_data, err := json.Marshal(values) if err != nil { log.Fatal(err) } url := "https://api2.watttime.org/v2/register" resp, err := http.Post(url, "application/json", bytes.NewBuffer(json_data)) if err != nil { log.Fatal(err) } defer resp.Body.Close() var res map[string]interface{} json.NewDecoder(resp.Body).Decode(&res) fmt.Println(res) } ``` After that, you should get the somewhat similar response to the below one. ``` { "user": "USERNAME", "ok": "User created" } ``` Next, let's get a token and get the grid emission data for the only one available region (CAISO\_NORTH). ``` package main import ( "fmt" "io/ioutil" "net/http" "net/url" "strings" "bytes" "encoding/json" ) func main() { loginURL := "https://api2.watttime.org/v2/login" req, _ := http.NewRequest("GET", loginURL, nil) // you will need to change this line with your USERNAME and PASSWORD req.SetBasicAuth("USERNAME", "PASSWORD") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) token := strings.Split(string(body), ":")[1] token = strings.TrimRight(strings.TrimLeft(token, "\""), "\"}\n") dataURL := "https://api2.watttime.org/v2/data" req, _ = http.NewRequest("GET", dataURL, nil) req.Header.Add("Authorization", "Bearer "+token) params := url.Values{} params.Add("ba", "CAISO_NORTH") params.Add("starttime", "2023-11-05T20:30:00-0800") params.Add("endtime", "2023-11-05T22:30:00-0800") req.URL.RawQuery = params.Encode() resp, _ = http.DefaultClient.Do(req) defer resp.Body.Close() body, _ = ioutil.ReadAll(resp.Body) fmt.Println(jsonPrettyPrint(string(body))) } func jsonPrettyPrint(in string) string { var out bytes.Buffer err := json.Indent(&out, []byte(in), "", "\t") if err != nil { return in } return out.String() } ``` You should get the response similar to the below one. ``` [ ... { "point_time": "2023-11-06T04:50:00.000Z", "value": 950.0, "frequency": 300, "market": "RTM", "ba": "CAISO_NORTH", "datatype": "MOER", "version": "3.2" }, { "point_time": "2023-11-06T04:45:00.000Z", "value": 950.0, "frequency": 300, "market": "RTM", "ba": "CAISO_NORTH", "datatype": "MOER", "version": "3.2" }, { "point_time": "2023-11-06T04:40:00.000Z", "value": 954.0, "frequency": 300, "market": "RTM", "ba": "CAISO_NORTH", "datatype": "MOER", "version": "3.2" }, { "point_time": "2023-11-06T04:35:00.000Z", "value": 955.0, "frequency": 300, "market": "RTM", "ba": "CAISO_NORTH", "datatype": "MOER", "version": "3.2" }, { "point_time": "2023-11-06T04:30:00.000Z", "value": 963.0, "frequency": 300, "market": "RTM", "ba": "CAISO_NORTH", "datatype": "MOER", "version": "3.2" } ] ``` Same as the above, we get the JSON data with which we can play around further. ### Methodology _WattTime_ uses grid's marginal emissions rate. And the API provides access to real-time, forecast, and historical marginal emission data. The rate provided is the Marginal Operating Emissions Rate (**MOER**). The unit is pounds of emissions per megawatt-hour (e.g. **CO2 lbs/MWh**). So to use it in the metric system part of the world, we would need to convert that to **gCO2eq/kWh**. _WattTime_ has built a marginal emissions model based on the empirical technique founder Gavin McCormick published. The fundamental approach of all those models is a somewhat similar. 1. Data is reported by emissions monitoring system through _EPA CAMPD program_ from the power plants within the US. Through the US _Environmental Protection Agency Clean Air Markets Program Data_. And now I finally understand why do they abbreviate everything there! I assume this is something similar to _ENTSOE_. 2. Each system then applies a regression-based modeling to ask every time a rise or fall in electricity demand occurs, which power plants increase/decrease their output in response. This allows for comparing marginal emissions by time and place. To discover more about their methodology, check out the link below. [Marginal Emissions Methodology – Watttime ![Image 9](https://www.watttime.org/app/uploads/2019/01/wattime_logo.png)WattTime Logo ![Image 10](https://www.watttime.org/app/themes/watttime/resources/assets/images/logo-header.png)](https://www.watttime.org/marginal-emissions-methodology/?ref=wonderingchimp.com) Key Takeaways ------------- **The purpose of this article is not a comparison of the two.** My goal was to explore the options and write down the things I found. Following are some key points I would like you to take from this article. * The APIs that give us carbon emissions data are there and waiting to be used! * Both of these I've written about offer free and paid options, which is good. If you are not paying for services, that often times means that you are the product. * The first step would be to use any of them. * To achieve the best results, we can test and use both, and compare them. Maybe one works better for us. Thanks for staying with the article until the end! If you liked it, feel free to share it with your friends, colleagues, peers, and on your social media. Also, feel free to use the comment section below to add your comments, overview, experience. See you in the next article! [5] Title: Climatiq - API for Carbon Footprint Calculations [5] URL Source: https://www.climatiq.io/ [5] Description: Use Climatiq’s API and emission factors database to measure carbon emissions when and where they happen. [5] Markdown Content: Climatiq - API for Carbon Footprint Calculations =============== [![Image 1](https://cdn.prod.website-files.com/5e44a3bcf37b47dfddc9a1d7/5e44f5da6e788abb7acd80d4_Chevron.svg)](https://www.climatiq.io/#returntotop) [![Image 2](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/60770ba173bfd052b37f0dd9_Climatiq_logo_400p-W.png)](https://www.climatiq.io/) [Product: Calculate](https://www.climatiq.io/calculate)[Product: Data](https://www.climatiq.io/our-data)[Data Explorer](https://www.climatiq.io/data)[API Docs](https://www.climatiq.io/docs)[Changelog](https://www.climatiq.io/changelog)[Customers](https://www.climatiq.io/customers)[Blog](https://www.climatiq.io/blog)[Pricing](https://www.climatiq.io/pricing)[About Us](https://www.climatiq.io/about)[Contact Sales](https://www.climatiq.io/contact-us) Products [![Image 3](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/654fa5353f31abb303b04a88_calculate-icon.png) CALCULATE ![Image 4](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/65a7910262513daf574865c9_Vector-2.png) Automated, accurate carbon emission calculations.](https://www.climatiq.io/calculate) Calculate Features [Freight & Shipping Emissions](https://www.climatiq.io/transportation-carbon-emissions) [Purchased Goods & Services Emissions](https://www.climatiq.io/purchased-goods-services) [Autopilot](https://www.climatiq.io/autopilot) [CBAM Emissions](https://www.climatiq.io/cbam) [Energy & Fuels Emissions](https://www.climatiq.io/energy-carbon-emissions) [Travel Emissions](https://www.climatiq.io/travel-carbon-emissions) [Supplier Emissions - Coming soon](https://www.climatiq.io/contact-us) [![Image 5](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/654fa55a88635290d963b840_data-icon.png) Data ![Image 6](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/65a7910262513daf574865c9_Vector-2.png) Access the largest database of vetted emission factors.](https://www.climatiq.io/our-data) Explore our data [Data Explorer](https://www.climatiq.io/data) [Methodology](https://www.climatiq.io/methodology) [Emission Factor Sources](https://www.climatiq.io/data/source) [ecoinvent Data](https://www.climatiq.io/ecoinvent-data) learn more Connect with our sales team [contact SALES](https://www.climatiq.io/contact-us) Solutions BY USE CASE [Carbon Measurement ![Image 7](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/607f1864a12f2d1ac15b5e41_Arrow-blue.svg)](https://www.climatiq.io/carbon-measurement) [Carbon Action ![Image 8](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/607f1864a12f2d1ac15b5e41_Arrow-blue.svg)](https://www.climatiq.io/carbon-action) BY PLATFORM TYPE [ERP ![Image 9](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/607f1864a12f2d1ac15b5e41_Arrow-blue.svg)](https://www.climatiq.io/erp-sustainability) [Supply Chain Management ![Image 10](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/607f1864a12f2d1ac15b5e41_Arrow-blue.svg)](https://www.climatiq.io/supply-chain-sustainability) [ESG & Sustainability ![Image 11](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/607f1864a12f2d1ac15b5e41_Arrow-blue.svg)](https://www.climatiq.io/esg-sustainability) INTEGRATIONS [Snowflake ![Image 12](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/607f1864a12f2d1ac15b5e41_Arrow-blue.svg)](https://app.snowflake.com/marketplace/listings/Climatiq) [Salesforce Net Zero Cloud ![Image 13](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/607f1864a12f2d1ac15b5e41_Arrow-blue.svg)](https://netzero.salesforce.com/s/provider?c__sc=CLIMATIQ) [Microsoft Excel ![Image 14](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/607f1864a12f2d1ac15b5e41_Arrow-blue.svg)](https://www.climatiq.io/excel-carbon-calculator) [Google Sheets ![Image 15](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/607f1864a12f2d1ac15b5e41_Arrow-blue.svg)](https://www.climatiq.io/carbon-calculations-google-sheets) Developers developer resources ![Image 16](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/654fd9135d8356f96dddcfdb_icon-dev2.png) [API Reference ![Image 17](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/607f1864a12f2d1ac15b5e41_Arrow-blue.svg)](https://www.climatiq.io/docs)Examples, tutorials and API references ![Image 18](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/654fd913f6654b94903449f2_icon-dev1.png) [Changelog ![Image 19](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/607f1864a12f2d1ac15b5e41_Arrow-blue.svg)](https://www.climatiq.io/changelog)Latest product releases and updates ![Image 20](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/654fa55a88635290d963b840_data-icon.png) [How-To Guides ![Image 21](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/607f1864a12f2d1ac15b5e41_Arrow-blue.svg)](https://www.climatiq.io/docs/guides)Resources to help you get started ![Image 22](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/654fd9134fc1773cbb1a9476_icon-dev7.png) [System Status ![Image 23](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/607f1864a12f2d1ac15b5e41_Arrow-blue.svg)](https://climatiq.statuspage.io/)Uptime and incident reports Demos ![Image 24](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/654fd9138009cb2c990279d3_icon-dev5.png) [Shipping Demo ![Image 25](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/607f1864a12f2d1ac15b5e41_Arrow-blue.svg)](https://intermodal.climatiq.io/)Try out our shipping & freight API ![Image 26](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/654fd9138009cb2c990279f0_icon-dev8.png) [Demo App ![Image 27](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/607f1864a12f2d1ac15b5e41_Arrow-blue.svg)](https://www.climatiq.io/demo)Try examples before writing code free signup Try our APIs with a free account [get started](https://www.climatiq.io/pricing) Resources Company [About Us ![Image 28](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/607f1864a12f2d1ac15b5e41_Arrow-blue.svg)](https://www.climatiq.io/about) [Scientific Advisory Board ![Image 29](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/607f1864a12f2d1ac15b5e41_Arrow-blue.svg)](https://www.climatiq.io/blog/announcing-climatiq-scientific-advisory-board-sab) [B Corp ![Image 30](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/607f1864a12f2d1ac15b5e41_Arrow-blue.svg)](https://www.climatiq.io/blog/climatiq-receives-b-corp-certification) [Careers ![Image 31](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/607f1864a12f2d1ac15b5e41_Arrow-blue.svg)](https://www.climatiq.io/about#jobs) [Trust Report ![Image 32](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/607f1864a12f2d1ac15b5e41_Arrow-blue.svg)](https://trust.climatiq.io/) Resources [Pricing ![Image 33](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/607f1864a12f2d1ac15b5e41_Arrow-blue.svg)](https://www.climatiq.io/pricing) [Product updates ![Image 34](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/607f1864a12f2d1ac15b5e41_Arrow-blue.svg)](https://www.climatiq.io/changelog) [Blog ![Image 35](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/607f1864a12f2d1ac15b5e41_Arrow-blue.svg)](https://www.climatiq.io/blog) [Guides ![Image 36](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/607f1864a12f2d1ac15b5e41_Arrow-blue.svg)](https://www.climatiq.io/docs/guides) [Support ![Image 37](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/607f1864a12f2d1ac15b5e41_Arrow-blue.svg)](https://www.climatiq.io/support) get in touch Connect with our sales team [contact sales](https://www.climatiq.io/contact-us) [Customers](https://www.climatiq.io/customers) [Contact sales](https://www.climatiq.io/contact-us)[Log in](https://app.climatiq.io/)[Get started](https://www.climatiq.io/pricing)[Get started ![Image 38](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/65a7900b34417e2862a499b2_Vector.png)](https://www.climatiq.io/pricing) The API for compliant carbon measurements ========================================= Product teams use Climatiq to enrich business data with carbon insights and launch trusted carbon management solutions in record time. [Get started ![Image 39](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/65a7900b34417e2862a499b2_Vector.png)](https://www.climatiq.io/pricing)[Contact sales ![Image 40](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/65a7910262513daf574865c9_Vector-2.png)](https://www.climatiq.io/contact-us) Trusted by hundreds of B2B software platforms * ![Image 41](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/63ee5164b20b2c3a3fd3bba6_Celonis_Logo.png) * ![Image 42](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/652942e53aea942d5dd72188_Salesforce-logo-300.png) * ![Image 43](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/653187869eed74d061433a92_cisco-logo2.png) * ![Image 44](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/666c3156e0eef92f11795570_DAT-Epicor-Logo-Teal-RGB.webp) * ![Image 45](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/656b4a3f84a7b6a965d013cf_IFS_logo-min.png) * ![Image 46](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/655f8957dc2d052b4b08f4cc_Novata-Logo-small.png) * ![Image 47](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/6418c057524b4fc8cf2f0bff_databricks-logo.png) * ![Image 48](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/6418c057ecc6e0ca68c914b4_Snowflake_Logo.png) * ![Image 49](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/65fc5b1e7054de18cc4bc85c_Zycus-logo.webp) * ![Image 50](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/66d803d8738d878ba01153e3_Blue_Yonder_rgb.png) * ![Image 51](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/6645c60968c1b5f642522cc4_Logotype%20Green.png) * ![Image 52](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/6418c3851ae294d87a25ee75_Granulate-logo.png) * ![Image 53](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/65fdbc11ac9aa4e2767fddfb_change-climate-logo.webp) * ![Image 54](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/6418c38406d6c504d7fa1f02_zalaris-site-logo.svg) Help your customers measure, report, and reduce their carbon footprint ------------------------------------------------------------------------- USE CASE ### Carbon Measurement Build carbon reporting and analytics tools to help your customers measure and monitor their emissions. [Learn more ![Image 55](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/65a7900b34417e2862a499b2_Vector.png)](https://www.climatiq.io/carbon-measurement) ![Image 56](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/65e5b7c8facbc3243a360f46_Carbon%20Measurement-solutions.png) ![Image 57](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/65e5a8b7b7482afd48cf1208_Carbon%20Action-solutions.png) USE CASE ### Carbon Action Build decision support and optimization tools to help your customers turn data into action and achieve their net-zero goals. [Learn more ![Image 58](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/65a7900b34417e2862a499b2_Vector.png)](https://www.climatiq.io/carbon-action) Deliver compliant carbon management solutions --------------------------------------------- ![Image 59](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/65a8de2edab3da91b5640331_pattern-3.png) #### Vetted emission factors Access up-to-date emission factors standardized and validated by in-house scientists. ![Image 60](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/65e5a419e60046795b8bd506_nav%20icon%201.png) #### Automated calculations Meet customer demand for carbon insights by automating emission factor mapping and calculations. ![Image 61](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/65a8dffe4a669225ac0d26e1_pattern-32.png) #### Embedded in your platform Accelerate your product roadmap and go-live faster with a robust and scalable API. Hear from our customers ======================= [Customers ![Image 62](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/65a7910262513daf574865c9_Vector-2.png)](https://www.climatiq.io/customers) "Our partnership with Climatiq represents a significant stride in the evolution of the Salesforce Net Zero Cloud ecosystem. This collaboration empowers our customers to **streamline their emissions calculations and reporting**, helping them reach their sustainability goals faster." ![Image 63](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/654e18a5a881a5569a876bd4_Nina%20Testimonial.png) Nina Schoen Director of Product, Net Zero Cloud @ Salesforce "With Climatiq as our partner, Novata has gained access to a **developer-friendly toolkit**, **industry leading data**, and **scientific expertise**. This partnership has played a crucial role in the development of our carbon calculation module and sped up time-to-market." ![Image 64](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/654e13a4a548b27d5c8de331_Mark%20Testimonial.png) Mark Fischel Product Manager @ Novata "Climatiq has played a pivotal role in enabling Celonis to swiftly expand our enterprise sustainability offerings. Our partnership has resulted in a suite of **new innovative features and apps**, garnering **overwhelmingly positive feedback**, and encouraging us to expand with new offerings." ![Image 65](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/654e138e6b3b83d910a491fa_Janina%20Testimonial.png) Janina Bauer Global Head of Sustainability @ Celonis "When searching for an accurate and compliant carbon calculation solution for travel emissions, Climatiq was the obvious choice. Their scientific expertise and extensive knowledge of the carbon calculation space has enabled us to provide **dependable and actionable emission insights** to our customers at scale." ![Image 66](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/654e139ca881a5569a844ff4_Dag%20Testimonial.png) Dag Oliver Chief Sustainability Officer @ Zalaris Integrate verified CO2e data into your platform in 3 steps ---------------------------------------------------------- ![Image 67](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/66227836e3b03d7028cf9714_API%20code%20graphic.webp) 1 Integrate the Climatiq API Use our globally distributed [REST API](https://www.climatiq.io/docs) with applications running on any device or server located in any data center. 2 Access data and calculate emissions Access the largest dataset of over 70,000 [emission factors](https://www.climatiq.io/our-data) from 36+ sources to automate [CO2e calculations](https://www.climatiq.io/calculate). 3 Launch your sustainability app Build bespoke solutions for your industry and help customers access [carbon insights](https://www.climatiq.io/carbon-measurement) and [take action](https://www.climatiq.io/carbon-action). ### Get started with automated emission calculations. [Get started ![Image 68](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/65a7910262513daf574865c9_Vector-2.png)](https://www.climatiq.io/pricing) [![Image 69](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/6673f655a73cb6eb72fa4408_27001%20RGB%20White.webp)](https://trust.climatiq.io/)[![Image 70](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/65d492332badba2c9217c25d_SOC-2-Logo-white.png)](https://trust.climatiq.io/)[![Image 71](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/65e8a3e3f509e873475c2554_gdpr-logo-white.png)](https://trust.climatiq.io/)[![Image 72](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/64cb77356b542a2d3a08f594_SmartFreightCentre-accreditation-logo-climatiq-min.png)](https://trust.climatiq.io/)![Image 73](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/64cb625df923738083a4a922_23_SXSW_Pitch_Winner_wht-small-min.png)![Image 74](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/64da645b6de7fe3c2bef1917_B-Corp-Logo-White-RGB.svg) [![Image 75](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/60770b2883993b70d858efe1_Climatiq_icon-white.png)](https://www.climatiq.io/) Climatiq provides an embedded carbon intelligence solution that enables developers to automate GHG emission calculations based on verified scientific models. Its suite of products includes the largest dataset of emission factors, and intelligent APIs that integrate with any software platform for real time monitoring of greenhouse gas emissions. Follow us: [![Image 76](https://cdn.prod.website-files.com/6059f5c21023d67f1f75b7bc/6074544ce6fe822cec255782_Climatiq_Linkedin.svg)](https://www.linkedin.com/company/climatiq/) PRODUCTS [Calculate](https://www.climatiq.io/calculate)[Data](https://www.climatiq.io/our-data) USE CASES [Carbon Measurement](https://www.climatiq.io/carbon-measurement)[Carbon Action](https://www.climatiq.io/carbon-action) FOR PLATFORMS [ERP](https://www.climatiq.io/erp-sustainability)[Supply Chain Management](https://www.climatiq.io/supply-chain-sustainability)[ESG & Sustainability](https://www.climatiq.io/esg-sustainability) [Resources](https://www.climatiq.io/#)[Changelog](https://www.climatiq.io/changelog)[API Docs](https://www.climatiq.io/docs)[API Playground](https://www.climatiq.io/demo)[Shipping Demo](https://intermodal.climatiq.io/)[Data Explorer](https://www.climatiq.io/data)[Blog](https://www.climatiq.io/blog)[Pricing](https://www.climatiq.io/pricing)[Sign up](https://app.climatiq.io/api/signup)[Login](https://app.climatiq.io/) Trust & security [Trust Report](https://trust.climatiq.io/)[System Status](https://climatiq.statuspage.io/) COMPANY [About us](https://www.climatiq.io/about)[Contact us](https://www.climatiq.io/contact-us)[Careers](https://climatiqtech.bamboohr.com/careers)[Media kit](https://climatiq.notion.site/Climatiq-Media-Kit-a49f49d7fdfe42ff914a0a1906ee9bb1)[Newsletter](https://www.climatiq.io/newsletter) [Terms & Conditions](https://www.climatiq.io/terms)[Impressum](https://www.climatiq.io/impressum)[Privacy Policy](https://www.climatiq.io/privacy-policy) © Climatiq 2024. All Rights Reserved Design by Urban Animal Studio