2

I'm trying to get a list of my datasets from the API. In version 1 of the API, a 'viz' call would return vizualizations (marked as "derived") and the underlying data (marked as type "table"), but it appears the API 1.0 isn't supported anymore, and version 2 doesn't return it.

I had hoped that the map call would returned a reference to the underlying data set(s), but that doesn't seem to be.

Any suggestions on how to programmatically get a list of an account's datasets?

asked Dec 28, 2015 at 12:05

1 Answer 1

1

You can do a select to the function CDB_UserTables to retrieve a list of user tables. This function does not belong to the public API: the behaviour is not guaranteed, but it could work for you -- Notice that for private requests ('private' or 'all'), your SQL API request needs to be authenticated. CartoDB does not currently have any public API for listing the datasets in an account.

With respect to:

I had hoped that the map call would returned a reference to the underlying data set(s), but that doesn't seem to be.

You can try to guess table names from the viz.json file of a map. This is an example of the "options" object that it contains for my layer:

options: {
sql: "select * from ne_50m_urban_areas",
layer_name: "ne_50m_urban_areas",
cartocss: "/** simple visualization */ #ne_50m_urban_areas{ polygon-fill: #FF6600; polygon-opacity: 0.7; line-color: #FFF; line-width: 0.5; line-opacity: 1; }",
cartocss_version: "2.1.1",
interactivity: "cartodb_id",
table_name: """."
}

This information will only appear if the data underneath is public. If it's private, the information is hidden.

answered Dec 28, 2015 at 12:25

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.