How to Extract Data From XBRL File in C#

In this step by step tutorial, we explain how to extract data from XBRL file in C#. By following this guide, you can not only extract data from XBRL file in C#, but also get data from iXBRL file in .NET, using the same process.

Steps to Extract Data From XBRL File in C#

  1. Install Aspose.Finance for .NET package from NuGet.org
  2. Include the needed namespaces to extract data from XBRL file
  3. Apply license to Aspose.Finance for .NET using SetLicense method
  4. Create InlineXbrlDocument object to read inline XBRL data from HTML file
  5. Now, you can extract data using properties of the InlineXbrlDocument object
  6. Use the extracted information for further processing in your code

The inline XBRL data is presented as an HTML file, which we’re reading in this tutorial and extracting XBRL data from that HTML file. The XBRL data can also be found in XML format, but we use a different class to extract that data from XML based XBRL file.

Code to Extract Data From XBRL File in C#

In this code sample, we first created an object of InlineXbrlDocument object, which provides access to various properties like ChildNodes, FirstChild, Footnotes, Facts, Contexts, Units, and various other properties of the XBRL data.

With the help of above code, you can easily access all the data and properties and then further consume and process using your .NET application code. This code will work for desktop, web, or other .NET applications alike. This working XBRL C# code sample is a good start for processing financial documents.

 English