« e2dot0 culture | Main | Václav Havel »
Sunday
11Oct2009

Using cURL to download a Google Spreadsheet as .xls (Excel)

First obtain a Authentication Token:
# curl https://www.google.com/accounts/ClientLogin -d Email=user@quantumcrypto.de –d Passwd=mysecretpassword –d accountType=HOSTED_OR_GOOGLE  -d source=cURL-Example -d service=wise

This will return something that looks as follows:

SID=DQAAAHYBADCv2pSv7nflacDNwz3zEDUGtrSvNVDcpkSfddi77b3U5sEaHmP8YLWhmA36F9rk85mL8J5dqo4apn0T1vKz0fPGI9Xtnuet6cuE2ZzYvrNIwbSC_HjTqF4zudNQnnlDuD2wqZT-g1qXI8KhGAQZV4NexHZoQPlabTsGuRZeIBxj1A
LSID=EUBBBIaBADCl-kNxvRVmcQghpt3cqSMfEooKR9flLOUZqwgP9OrZS83gse-KSdTNeXhxsET7FYenDhceP9lIPOmesH-t9qh-AWUHjjMdZEbUNeF9mWyzln6Z-FajaiG-cVFkqW0ZJ8ZbnCP30xXj6xFK6QxaAcqy_9Pej8jhEnxS9E61ftQGPg
Auth=EUBBIacAAADK-kNxvRVmcQghpt3cqSMfEooLNMflLNIQqwgP9OrZS83gs-KSdTNeXhxsET7FYePWmaD8Vsy1V4LSUGMUP48Je2TO8OcjBj6HgAtPhiZeX-gKDfagZDK44j4n-Tkb44nhOnp2_QPSnBj3Z2vYwOEDjjG3Q53aQVC2132JKOuGh


To export a Google Spreadsheet as .xls (Excel):
# curl --silent --header "Authorization: GoogleLogin auth=AUTHKEY" http://spreadsheets.google.com/feeds/download/spreadsheets/Export?key=spreadsheetkey&exportFormat=xls

exportFormat Parameter Value Format of the returned Spreadsheet
xls XLS (Microsoft Excel)
csv CSV (Comma Separated Value)
pdf PDF (Portable Document Format)
ods ODS (Open Document Spreadsheet)
tsv TSV (Tab Separated Value)
html HTML Format

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments (1)

Great information thanks want more information on..

Exercise to flatten stomach
... can you post...

March 12, 2010 | Unregistered CommenterStomach fat exercises

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>