43

Does anyone know if there is any official documentation for google spreadsheet embed URL paramaters?

That is, given an embed URL from Google Sheets like this: https://docs.google.com/a/aicr.org/spreadsheet/pub?key=0AhExuVBhVYT1dGxxejBmUHAzYUhGb25veTRkdW1YekE&single=true&gid=1&output=html&gridlines=false

  1. What do the arguments do, and
  2. What other arguments are available, that aren't included by default?

After much digging and searching, I have found:

  • Some parameters don't seem to do anything (&single=true, &embedded=true)
  • Some parameters are declared confidently in google search results, but don't work (&gridlines=false)
  • Some parameters don't seem to appear in any searches I have done (&output=csv)

... and no search I have done has produced anything even remotely approaching either of:

  • an official, google-maintained document for embed URLs
  • a code view of the code that is used to parse the embed URLs

By trial and error I have found:

  • &key=[ID]
    • google sheet ID
  • &single=[true|false]
    • true: ??? (present when I have published only a single sheet)
    • false: ???
  • &gid=[#]
    • sheet ID ??? (present when I have published only a single sheet)
    • perhaps this can be used to specify a sheet and range when your entire google sheets doc has been 'published to the web' (instead of just one sheet from your doc)
  • &range=[CellAddress1:CellAddress2]
    • specify a range of cells to include, eg "B1:C20"
    • if 'widget=' is false or not present, suppresses display of the usual google header & footer info
    • if the range spacified is larger than the published sheet, displays only the sheet while still suppressing the header and footer.
  • &embedded=[true|false]
    • true: ???
    • false: ???
    • this item is included in the embed code offered from within google sheets (set to "true"), but doesn't seem to have any effect.
  • &widget=[true|false]
    • true: display entire shared item. Overrides "range=". Does NOT include the google disclaimer footer.
    • false: include google disclaimer footer in output (unless 'range=' is also present)
  • &output=[html|txt|csv]
    • html (default): output as an html table within code that also includes Google tracking code
    • txt: output the content of the specified range or sheet as tab separated text
    • csv: output as csv
  • &gridlines=[???]
    • this apparently used to work but doesn't work for me.
    • To suppress gridlines in embedded sheets I set borders on all cells, then color the borders to match the sheet's background color (eg solid white borders on a white-background sheet).
4
  • it looks like "range" doesn't work when exporting to .xlsx. Only .csv Oct 1, 2019 at 13:30
  • 1
    How are you specifying 'export to .xlsx'? This post is about documenting the URL parameters that can be used when embedding a google sheet into a web page.
    – mmccarn
    Oct 4, 2019 at 2:51
  • 1
    Sorry, I should be more specific. The "range" parameter doesn't work when using it with the "format" parameter to export a sheet as .xlsx. No matter what range is specified, it exports the entire sheet. It works when exporting as .csv though. Here's an example: yourspreadsheetURL/export?format=xlsx&range=A2:AN Apr 28, 2020 at 21:09
  • any url to search in Google Sheets?
    – vstepaniuk
    Dec 4, 2023 at 11:25

3 Answers 3

25

Here are some of the parameters I found for Google Docs (thanks goes to Joel http://obstruction.tumblr.com/post/60784440737/google-docs-url-parameters-rm-minimal-rm-full):

Google Docs URL parameters:

rm=minimal
rm=full
rm=embedded
rm=demo
rm=(render mode)

ui=2 (select the interface version)
chrome=false (full screen mode)
frameborder=(size of border)
q=(Whatever) Search Query

gid=24 (Which sheet you want to display)
widget=false
single=true
range=A2:AA26 Output=html
format=(export spreadsheet)
format=xlsx
format=csv

widget=false
width=(width)
height=(height)
viewer?
start=
channel=
ibd=
client=
5
  • 4
    chrome=false is useful for hiding the header/top bar Jan 4, 2020 at 3:56
  • The only options working as of today for rm are full and embedded. The others won't work.
    – Morfinismo
    Mar 12, 2020 at 23:22
  • @jarrettyeo I mean, it works, but it does not provide what it used to provide before. So even if you try it without the rm=minimal it is still the same. That is what I meant.
    – Morfinismo
    Mar 18, 2020 at 0:21
  • 1
    There's also "format=xlsx" (to export a spreadsheet as xlsx or, .csv) Apr 28, 2020 at 21:13
  • 1
    If you have single=false&widget=false&headers=false then the tab name is hidden, and you just see the tab contents. Aug 6, 2021 at 21:45
4

I've been looking for the same thing! One more URL parameter I have found useful is

  • &rm=[minimal|?]
    • minimal: hides the top menu and cell inspector, but still shows row numbers, column letters, and the Add More Rows feature at the bottom.

This resource describes some of the parameters, though I can't vouch for its accuracy. http://www.goopal.org/google-sites-business/google-spreadsheets/spreadsheet-output/publish-spreadsheet#TOC-Other-Export-Parameters

2

The most helpful list of parameters I found comes from Steegle.com.

You can use the htmlembed URL to display just a range from a Google Sheet - here's how to structure the URL

https://docs.google.com/spreadsheets/d/SpreadsheedID/htmlembed?single=true&gid=SheetID&range=D15:E15&widget=false&chrome=false&headers=false
  • SpreadsheedID should be the long letters, numbers and characters you get in the normal URL

  • htmlembed is for sheets you have not published: use pubhtml instead if you have chosen to publish the sheet (if you want the public to see it it's the best way

  • single never been sure what it does, but we think it helps with only showing a single sheet instead of multiple sheets

  • SheetID is the sheet number you get in the normal URL after the ?gid= (this is not the sheet name you have specified but the automatic number that Google Sheets provides)

  • range lets you specify the range of cells you want to display

  • widget lets you choose whether to display the sheet tabs at the bottom

  • chrome lets you choose whether to display the spreadsheet title (& sheetname) at the top

  • headers lets you choose whether to display the spreadsheet title at the top

Source: https://www.steegle.com/google-sites/how-to/insert-websites-apps-scripts-and-gadgets/embed-google-sheet-range

1
  • 1
    After playing around with the parameters, I figured out what &single=false does. If your Google Sheet has multiple tabs that you'd like the user to view, you can use &single=false in combination with &widget=true to display other available tabs at the bottom of the page. But, there must be a way to provide a range for the other tabs as well because right now it doesn't anything but one cell in the 2nd tab I have. May 11, 2023 at 15:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.