{"id":4250,"date":"2018-06-30T03:02:59","date_gmt":"2018-06-30T03:02:59","guid":{"rendered":"https:\/\/zappysys.com\/blog\/?p=4250"},"modified":"2024-02-06T12:11:43","modified_gmt":"2024-02-06T12:11:43","slug":"how-to-export-rest-api-to-csv","status":"publish","type":"post","link":"https:\/\/zappysys.com\/blog\/how-to-export-rest-api-to-csv\/","title":{"rendered":"How to export REST API  to CSV using c# or Python"},"content":{"rendered":"<h2>Introduction to export REST API to CSV<\/h2>\n<p><a href=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/06\/REST-API-icon.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-4254 alignleft\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/06\/REST-API-icon-150x150.jpg\" alt=\"Logo REST API\" width=\"82\" height=\"82\" \/><\/a>Export REST API to CSV is in some cases necessary to process the data because\u00a0many tools can handle CSV files. In this new article, we will show different ways\u00a0to export the data. The first example will do it using C#. The second example\u00a0with use Python. Let&#8217;s take a look at these examples.<\/p>\n<h2><\/h2>\n<h2>Requirements to export REST API to CSV<\/h2>\n<ol>\n<li>First of all, you will need\u00a0<a href=\"https:\/\/zappysys.com\/products\/odbc-powerpack\/download\/\" target=\"_blank\" rel=\"noopener\">ZappySys ODBC PowerPack<\/a> installed.<\/li>\n<li>Secondly, you will require Visual Studio installed for the C# example.<\/li>\n<li>Finally, it is necessary Python installed for the Python example.<\/li>\n<\/ol>\n<h3>Export REST API to CSV using C#<\/h3>\n<p>C# is a pretty popular programing language. In the first example, we will\u00a0show how to display the REST API information to a CSV file named. Let&#8217;s take a\u00a0look at the code:<\/p>\n<ol>\n<li>First of all, we will connect to REST API using a connection to the\u00a0following Data Path:\n<pre class=\"lang:default highlight:0 decode:true\">https:\/\/services.odata.org\/V3\/Northwind\/Northwind.svc\/Customers?$format=json\r\n<\/pre>\n<pre class=\"lang:c# decode:true\">using (OdbcConnection conn = \r\n      new OdbcConnection(\"Driver={ZappySys JSON Driver};DataPath='https:\/\/services.odata.org\/V3\/Northwind\/Northwind.svc\/Customers?$format=json';\"))\r\n<\/pre>\n<\/li>\n<li>Secondly, we create a connection using a file stream. We will save the\u00a0results to a file in the c:\\sql\\sample.csv:\n<pre class=\"lang:c# decode:true \">FileStream fs = new FileStream(\"C:\\\\sql\\\\sample.txt\", FileMode.Create);\r\nStreamWriter writer = new StreamWriter(fs);\r\nStringBuilder output = new StringBuilder();<\/pre>\n<\/li>\n<li>Also, we will add a query to REST API. Note that with the ZappySys ODBC\u00a0PowerPack, you can do a simple SQL query to get REST API data. This is\u00a0pretty simple and intuitive:\n<pre class=\"lang:c# decode:true\">OdbcCommand cmd = new OdbcCommand(\r\n     @\"SELECT  CustomerID,CompanyName FROM value\", conn);\r\n<\/pre>\n<\/li>\n<li>In addition, we will read the data and close the connections:\n<pre class=\"lang:c# decode:true\">conn.Close();  \r\nwriter.Close(); \r\nfs.Close();<\/pre>\n<\/li>\n<li>The complete code will be the following:\n<pre class=\"lang:c# decode:true \">using System;\r\nusing System.IO;\r\nusing System.Data.Odbc;\r\n\r\npublic class Program\r\n{\r\n    public static void Main()\r\n    {\r\n        var outpath = @\"C:\\temp\\sample.txt\";\r\n\r\n        using (var conn = new OdbcConnection(\"Driver={ZappySys JSON Driver};DataPath='https:\/\/services.odata.org\/V3\/Northwind\/Northwind.svc\/Customers?$format=json';\"))\r\n        {\r\n            conn.Open();\r\n            var cmd = new OdbcCommand(@\"SELECT CustomerID,CompanyName FROM $ WITH(Filter='$.value[*]')\", conn);\r\n            \r\n            \/\/Increases the timeout duration from the default 30 seconds, which may be insufficient in certain scenarios.\r\n            cmd.CommandTimeout=600; \/\/ 600-seconds\r\n            \r\n            var rdr = cmd.ExecuteReader();\r\n\r\n            using (var fs = new FileStream(outpath, FileMode.Create))\r\n            {\r\n                using (var writer = new StreamWriter(fs))\r\n                {\r\n                    \/\/write file header\r\n                    writer.WriteLine(\"CustomerID,CompanyName\");\r\n\r\n                    while (rdr.Read())\r\n                    {\r\n                        \/\/write file row\r\n                        writer.WriteLine(\"{0},{1}\", rdr[\"CustomerID\"], rdr[\"CompanyName\"]);\r\n                    }\r\n                    conn.Close(); \/\/close connection\r\n                    writer.Close();\r\n                    fs.Close();\r\n                }\r\n            }\r\n        }\r\n\r\n        \/\/Read from file and display the content\r\n        Console.Write(File.ReadAllText(outpath));\r\n\r\n        Console.WriteLine(\"\\r\\n===== Press any key to end the program =====\\r\\n\");\r\n        Console.Read();\r\n    }\r\n}<\/pre>\n<p>&nbsp;<\/li>\n<li>Finally, you will be able to see the file created:\n<div id=\"attachment_4258\" style=\"width: 160px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/06\/REST-API-exported-to-CSV-file.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4258\" class=\"size-thumbnail wp-image-4258\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/06\/REST-API-exported-to-CSV-file-150x150.png\" alt=\"Export REST API to CSV\" width=\"150\" height=\"150\" \/><\/a><p id=\"caption-attachment-4258\" class=\"wp-caption-text\">REST API into CSV<\/p><\/div><\/li>\n<\/ol>\n<h3>Export REST API to CSV using Python<\/h3>\n<p>Python is another really popular programming language. The popularity is\u00a0growing a lot. In this example, we will learn how to Export REST API to CSV\u00a0using Python.<\/p>\n<ol>\n<li>First of all, you will need to install Pip if not included in Python. Pip is Package Installer.<br \/>\nFor instructions about the installation, refer to\u00a0<a href=\"https:\/\/pip.pypa.io\/en\/stable\/installing\/\" target=\"_blank\" rel=\"noopener\">this link.<\/a><\/li>\n<li>Secondly, you will also need the pyodbc. The pyodbc allows connecting to\u00a0ODBC using Python. To install it go to the scripts folder of Python where\u00a0Python is installed and run this command:pip install pyodbc.<\/li>\n<li>Once that pyodbc is installed, we will run the following code:<strong>Full Code<\/strong>\n<pre class=\"lang:python decode:true \">import csv\r\nimport pyodbc\r\n\r\nconn = pyodbc.connect(\r\n    r'DRIVER={ZappySys JSON Driver};'\r\n    )\r\ncursor = conn.cursor()\t\r\nrows = cursor.execute(\"SELECT CustomerID,CompanyName FROM value WHERE COUNTRY='Germany' WITH (SRC='https:\/\/services.odata.org\/V3\/Northwind\/Northwind.svc\/Customers?$format=json')\") \r\nwith open(r'C:\\sql\\cus2.csv', 'w', newline='') as csvfile:\r\n    writer = csv.writer(csvfile)\r\n    writer.writerow([x[0] for x in cursor.description])  \r\n    for row in rows:\r\n        writer.writerow(row)<\/pre>\n<\/li>\n<li>Now lets&#8217;s understand parts of above code. We have used the csv and pyodbc modules in the code:\n<pre class=\"lang:python decode:true\">import csv\r\nimport pyodbc<\/pre>\n<\/li>\n<li>Also, we connect to the <a href=\"https:\/\/zappysys.com\/products\/odbc-powerpack\/\" target=\"_blank\" rel=\"noopener\">ZappySys ODBC Driver<\/a>:\n<pre class=\"lang:python decode:true\">conn = pyodbc.connect(\r\nr'DRIVER={ZappySys JSON Driver};'\r\n)<\/pre>\n<\/li>\n<li>In addition,\u00a0we have used a cursor to get the rows and send a SQL query to get data\u00a0from the REST API:\n<pre class=\"lang:python decode:true\">cursor = conn.cursor() \r\nrows = cursor.execute(\"SELECT CustomerID,CompanyName FROM value \r\nWHERE Country='Germany' WITH \r\n(SRC='https:\/\/services.odata.org\/V3\/Northwind\/Northwind.svc\/Customers?$format=json')\")<\/pre>\n<\/li>\n<li>Following code is to open the CSV file stream:\n<pre class=\"lang:python decode:true\">with open(r'C:\\sql\\customer.csv', 'w', newline='') as csvfile:<\/pre>\n<\/li>\n<li>Finally, we will write the data from REST API into the CSV file:\n<pre class=\"lang:c# decode:true\">writer = csv.writer(csvfile)\r\nwriter.writerow([x[0] for x in cursor.description]) \r\nfor row in rows:\r\nwriter.writerow(row)<\/pre>\n<\/li>\n<li>To conclude, if everything is OK, you will be able to see the created CSV file:\n<div id=\"attachment_4264\" style=\"width: 160px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/06\/CSV-file-created.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4264\" class=\"size-thumbnail wp-image-4264\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/06\/CSV-file-created-150x106.png\" alt=\"REST API ODBC Python\" width=\"150\" height=\"106\" \/><\/a><p id=\"caption-attachment-4264\" class=\"wp-caption-text\">Python code REST API<\/p><\/div>\n<div class=\"mceTemp\"><\/div>\n<\/li>\n<\/ol>\n<h2><\/h2>\n<h2>Using ODBC DSN in Connection String<\/h2>\n<p>So far we have seen DSN less connection string approach for ODBC Driver but now lets look at another way to use ODBC Driver in your C# or Python code. You can define many settings on DSN Datasource rather than setting in the ConnectionString.<\/p>\n<h3>Configure DSN for REST API Connection<\/h3>\n<ol>\n<li>First of all, we will access the following URL:\n<pre class=\"lang:default highlight:0 decode:true\">https:\/\/services.odata.org\/V3\/Northwind\/Northwind.svc\/Orders?$format=json<\/pre>\n<\/li>\n<li>Secondly, in the windows start menu, Search for \u201cODBC\u201d open the ODBC Data Sources.<\/li>\n<li>Also, in the ODBC Administrator, press Add and select the ZappySys JSON<br \/>\nDriver:<\/p>\n<div id=\"attachment_4421\" style=\"width: 471px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/07\/create-new-data-source-zappysys-json-driver.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4421\" class=\"wp-image-4421 size-full\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/07\/create-new-data-source-zappysys-json-driver.png\" alt=\"REST API ODBC \" width=\"461\" height=\"346\" srcset=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/07\/create-new-data-source-zappysys-json-driver.png 461w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/07\/create-new-data-source-zappysys-json-driver-300x225.png 300w\" sizes=\"(max-width: 461px) 100vw, 461px\" \/><\/a><p id=\"caption-attachment-4421\" class=\"wp-caption-text\">Add ODBC JSON<\/p><\/div><\/li>\n<li>Finally, specify the URL of step 1 and save the configuration:\n<div id=\"attachment_4422\" style=\"width: 812px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/07\/Qlik-odata-url-odbc.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4422\" class=\"size-full wp-image-4422\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/07\/Qlik-odata-url-odbc.png\" alt=\"REST API\" width=\"802\" height=\"702\" srcset=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/07\/Qlik-odata-url-odbc.png 802w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/07\/Qlik-odata-url-odbc-300x263.png 300w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/07\/Qlik-odata-url-odbc-768x672.png 768w\" sizes=\"(max-width: 802px) 100vw, 802px\" \/><\/a><p id=\"caption-attachment-4422\" class=\"wp-caption-text\">URL ODBC<\/p><\/div><\/li>\n<\/ol>\n<h3>Using ODBC DSN in C# Code<\/h3>\n<p>Now to use ODBC DSN you created simply change our previous C# Code as below (Just one line)<\/p>\n<pre class=\"lang:c# decode:true \">using (var conn = new OdbcConnection(\"DSN=Your-DSN-Name-Goes-Here\"))\r\n{\r\n    conn.Open();\r\n    ...........\r\n    ...........\r\n    ...........\r\n<\/pre>\n<div id=\"attachment_4467\" style=\"width: 883px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/06\/call-rest-api-in-csharp-odbc-json-driver.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4467\" class=\"size-full wp-image-4467\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/06\/call-rest-api-in-csharp-odbc-json-driver.png\" alt=\"Using ODBC DSN in C# code to call REST API\" width=\"873\" height=\"598\" srcset=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/06\/call-rest-api-in-csharp-odbc-json-driver.png 873w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/06\/call-rest-api-in-csharp-odbc-json-driver-300x205.png 300w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/06\/call-rest-api-in-csharp-odbc-json-driver-768x526.png 768w\" sizes=\"(max-width: 873px) 100vw, 873px\" \/><\/a><p id=\"caption-attachment-4467\" class=\"wp-caption-text\">Using ODBC DSN in C# code to call REST API<\/p><\/div>\n<h3>Using ODBC DSN in Python Code<\/h3>\n<p>Now to use ODBC DSN you created simply change our previous C# Code as below (Just one line)<\/p>\n<pre class=\"lang:python decode:true \">conn = pyodbc.connect(\r\n    r'DSN=Your-DSN-name-Goes-Here;'\r\n    )\r\n\t\r\n\t...........\r\n\t...........\r\n\t...........<\/pre>\n<p>&nbsp;<\/p>\n<h2><span id=\"ZappySys_JSON_REST_API_Driver_Query_Examples\">ZappySys JSON \/REST API Driver Query Examples<\/span><\/h2>\n<p>Reading from XML files or API can be done using the same way as previous sections except you have to use ZappySys XML Driver. Read help file here to\u00a0<a href=\"https:\/\/zappysys.com\/onlinehelp\/odbc-powerpack\/scr\/json-odbc-driver-sql-query-examples.htm\" target=\"_blank\" rel=\"noopener\">see json query examples<\/a>.<\/p>\n<h2><span id=\"ZappySysXML_SOAP_Driver_Query_Examples\">ZappySys\u00a0XML \/ SOAP Driver Query Examples<\/span><\/h2>\n<p>Reading from XML files or API can be done using the same way as previous sections except you have to use ZappySys XML Driver. Read help file here to\u00a0<a href=\"https:\/\/zappysys.com\/onlinehelp\/odbc-powerpack\/scr\/xml-odbc-driver-sql-query-examples.htm\" target=\"_blank\" rel=\"noopener\">see xml query examples<\/a>.<\/p>\n<h2><\/h2>\n<h2>Conclusion<\/h2>\n<p>To conclude,\u00a0in this article, we show how to access REST API using C# and Python. We\u00a0used the ZappySys ODBC PowerPack that allows accessing to REST API data and JSON\u00a0files using SQL queries. It is possible to create simple SQL queries and\u00a0access the data. It is also possible to access to XML files and Web API with\u00a0this tool. If you liked this tool you can test the\u00a0<a href=\"https:\/\/zappysys.com\/products\/odbc-powerpack\/download\/\" target=\"_blank\" rel=\"noopener\">ZappySys ODBC PowerPack here<\/a>.<\/p>\n<h2>References<\/h2>\n<p>Finally, if you want to read more about this topic, refer to these links:<\/p>\n<ul>\n<li><a href=\"https:\/\/zappysys.com\/products\/odbc-powerpack\/download\/\" target=\"_blank\" rel=\"noopener\">Download ZappySys ODBC\u00a0PowerPack Installer<\/a><\/li>\n<li><a href=\"https:\/\/support.microsoft.com\/en-us\/help\/310988\/how-to-use-the-odbc-net-managed-provider-in-visual-c-net-and-connectio\" target=\"_blank\" rel=\"noopener\">How To Use the ODBC .NET Managed Provider in Visual C# .NET and Connection Strings<\/a><\/li>\n<li><a href=\"https:\/\/wiki.python.org\/moin\/ODBC\" target=\"_blank\" rel=\"noopener\">Python ODBC Wiki<\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction to export REST API to CSV Export REST API to CSV is in some cases necessary to process the data because\u00a0many tools can handle CSV files. In this new article, we will show different ways\u00a0to export the data. The first example will do it using C#. The second example\u00a0with use Python. Let&#8217;s take a [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":4254,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[342,277,276,343],"tags":[37,128,22,273,300,3],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\r\n<title>How to export REST API to CSV using c# or Python | ZappySys Blog<\/title>\r\n<meta name=\"description\" content=\"In this article, we will show how to export REST API to CSV. We will use C# and also Python to do this. You can use the language of your preference.\" \/>\r\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\r\n<link rel=\"canonical\" href=\"https:\/\/zappysys.com\/blog\/how-to-export-rest-api-to-csv\/\" \/>\r\n<meta property=\"og:locale\" content=\"en_US\" \/>\r\n<meta property=\"og:type\" content=\"article\" \/>\r\n<meta property=\"og:title\" content=\"How to export REST API to CSV using c# or Python | ZappySys Blog\" \/>\r\n<meta property=\"og:description\" content=\"In this article, we will show how to export REST API to CSV. We will use C# and also Python to do this. You can use the language of your preference.\" \/>\r\n<meta property=\"og:url\" content=\"https:\/\/zappysys.com\/blog\/how-to-export-rest-api-to-csv\/\" \/>\r\n<meta property=\"og:site_name\" content=\"ZappySys Blog\" \/>\r\n<meta property=\"article:published_time\" content=\"2018-06-30T03:02:59+00:00\" \/>\r\n<meta property=\"article:modified_time\" content=\"2024-02-06T12:11:43+00:00\" \/>\r\n<meta property=\"og:image\" content=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/06\/REST-API-icon.jpg\" \/>\r\n\t<meta property=\"og:image:width\" content=\"217\" \/>\r\n\t<meta property=\"og:image:height\" content=\"232\" \/>\r\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\r\n<meta name=\"author\" content=\"ZappySys Team\" \/>\r\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\r\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"ZappySys Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\r\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/zappysys.com\/blog\/how-to-export-rest-api-to-csv\/\",\"url\":\"https:\/\/zappysys.com\/blog\/how-to-export-rest-api-to-csv\/\",\"name\":\"How to export REST API to CSV using c# or Python | ZappySys Blog\",\"isPartOf\":{\"@id\":\"https:\/\/zappysys.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/zappysys.com\/blog\/how-to-export-rest-api-to-csv\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/zappysys.com\/blog\/how-to-export-rest-api-to-csv\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/06\/REST-API-icon.jpg\",\"datePublished\":\"2018-06-30T03:02:59+00:00\",\"dateModified\":\"2024-02-06T12:11:43+00:00\",\"author\":{\"@id\":\"https:\/\/zappysys.com\/blog\/#\/schema\/person\/91b041e2dcf7ece5f068893c1a68ac6e\"},\"description\":\"In this article, we will show how to export REST API to CSV. We will use C# and also Python to do this. You can use the language of your preference.\",\"breadcrumb\":{\"@id\":\"https:\/\/zappysys.com\/blog\/how-to-export-rest-api-to-csv\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/zappysys.com\/blog\/how-to-export-rest-api-to-csv\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/zappysys.com\/blog\/how-to-export-rest-api-to-csv\/#primaryimage\",\"url\":\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/06\/REST-API-icon.jpg\",\"contentUrl\":\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/06\/REST-API-icon.jpg\",\"width\":217,\"height\":232,\"caption\":\"Logo REST API\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/zappysys.com\/blog\/how-to-export-rest-api-to-csv\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/zappysys.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to export REST API to CSV using c# or Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/zappysys.com\/blog\/#website\",\"url\":\"https:\/\/zappysys.com\/blog\/\",\"name\":\"ZappySys Blog\",\"description\":\"SSIS \/ ODBC Drivers \/ API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/zappysys.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/zappysys.com\/blog\/#\/schema\/person\/91b041e2dcf7ece5f068893c1a68ac6e\",\"name\":\"ZappySys Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/zappysys.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/746bec9c9d27f1b90bb181aa516ee234?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/746bec9c9d27f1b90bb181aa516ee234?s=96&d=mm&r=g\",\"caption\":\"ZappySys Team\"},\"sameAs\":[\"https:\/\/zappysys.com\"],\"url\":\"https:\/\/zappysys.com\/blog\/author\/dcalbimonte\/\"}]}<\/script>\r\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to export REST API to CSV using c# or Python | ZappySys Blog","description":"In this article, we will show how to export REST API to CSV. We will use C# and also Python to do this. You can use the language of your preference.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/zappysys.com\/blog\/how-to-export-rest-api-to-csv\/","og_locale":"en_US","og_type":"article","og_title":"How to export REST API to CSV using c# or Python | ZappySys Blog","og_description":"In this article, we will show how to export REST API to CSV. We will use C# and also Python to do this. You can use the language of your preference.","og_url":"https:\/\/zappysys.com\/blog\/how-to-export-rest-api-to-csv\/","og_site_name":"ZappySys Blog","article_published_time":"2018-06-30T03:02:59+00:00","article_modified_time":"2024-02-06T12:11:43+00:00","og_image":[{"width":217,"height":232,"url":"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/06\/REST-API-icon.jpg","type":"image\/jpeg"}],"author":"ZappySys Team","twitter_card":"summary_large_image","twitter_misc":{"Written by":"ZappySys Team","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/zappysys.com\/blog\/how-to-export-rest-api-to-csv\/","url":"https:\/\/zappysys.com\/blog\/how-to-export-rest-api-to-csv\/","name":"How to export REST API to CSV using c# or Python | ZappySys Blog","isPartOf":{"@id":"https:\/\/zappysys.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/zappysys.com\/blog\/how-to-export-rest-api-to-csv\/#primaryimage"},"image":{"@id":"https:\/\/zappysys.com\/blog\/how-to-export-rest-api-to-csv\/#primaryimage"},"thumbnailUrl":"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/06\/REST-API-icon.jpg","datePublished":"2018-06-30T03:02:59+00:00","dateModified":"2024-02-06T12:11:43+00:00","author":{"@id":"https:\/\/zappysys.com\/blog\/#\/schema\/person\/91b041e2dcf7ece5f068893c1a68ac6e"},"description":"In this article, we will show how to export REST API to CSV. We will use C# and also Python to do this. You can use the language of your preference.","breadcrumb":{"@id":"https:\/\/zappysys.com\/blog\/how-to-export-rest-api-to-csv\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/zappysys.com\/blog\/how-to-export-rest-api-to-csv\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/zappysys.com\/blog\/how-to-export-rest-api-to-csv\/#primaryimage","url":"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/06\/REST-API-icon.jpg","contentUrl":"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/06\/REST-API-icon.jpg","width":217,"height":232,"caption":"Logo REST API"},{"@type":"BreadcrumbList","@id":"https:\/\/zappysys.com\/blog\/how-to-export-rest-api-to-csv\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/zappysys.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to export REST API to CSV using c# or Python"}]},{"@type":"WebSite","@id":"https:\/\/zappysys.com\/blog\/#website","url":"https:\/\/zappysys.com\/blog\/","name":"ZappySys Blog","description":"SSIS \/ ODBC Drivers \/ API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/zappysys.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/zappysys.com\/blog\/#\/schema\/person\/91b041e2dcf7ece5f068893c1a68ac6e","name":"ZappySys Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/zappysys.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/746bec9c9d27f1b90bb181aa516ee234?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/746bec9c9d27f1b90bb181aa516ee234?s=96&d=mm&r=g","caption":"ZappySys Team"},"sameAs":["https:\/\/zappysys.com"],"url":"https:\/\/zappysys.com\/blog\/author\/dcalbimonte\/"}]}},"_links":{"self":[{"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/posts\/4250"}],"collection":[{"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/comments?post=4250"}],"version-history":[{"count":17,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/posts\/4250\/revisions"}],"predecessor-version":[{"id":10947,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/posts\/4250\/revisions\/10947"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/media\/4254"}],"wp:attachment":[{"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/media?parent=4250"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/categories?post=4250"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/tags?post=4250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}