Questions tagged [socrata]

Socrata is a company which provides government data services. Use this tag for questions about Socrata products, including the SODA API (http://dev.socrata.com/); and also indicate the Socrata product such as Data Portal, GovStat, or API Foundry. If your question is not closely related to programming, please consider asking your question on https://opendata.stackexchange.com.

Socrata is a company which provides government data services. From 2007 to 2009, it was known as Blist. Use this tag for questions about Socrata products, including the SODA API; and also indicate the Socrata product such as Data Portal, GovStat, or API Foundry.

235 questions
5
votes
1 answer

Is there a Socrata API method to get the row count of a dataset?

Is there any fast way to get the number of rows in a dataset? The best idea I can come up with is to do binary probing using $limit and $offset, or maybe some hybrid of binary probing and a final fetch of a single column within a $limit/$offset…
Ed Staub
  • 15,480
  • 3
  • 61
  • 91
3
votes
1 answer

SODA API not returning all fields in data set

I am having trouble obtaining all of the fields in a dataset from the Socrata Open Data Network. I am using urllib3 to make the request as such: url = 'https://data.sfgov.org/resource/g8m3-pdis.json' http =…
KoalaKey
  • 252
  • 3
  • 11
3
votes
1 answer

unable to find an inherited method for function ‘dbWriteTable’ for signature ‘"RODBC", "character", "data.frame"’

I'm attempting to pull data through an api call save as a r dtaframe then copy the r dataframe to MS Sql server. The api call and connection to Sql server works perfectly. However, whenever I try to copy the r dataframe to sql server I get an error…
Sharon M
  • 194
  • 5
  • 15
3
votes
1 answer

Socrata/SODA API call via JQuery not returning the entire dataset

I am making a GET call to the following table: https://data.cityofnewyork.us/Social-Services/Halloween-Noise-Lat-Long/25yv-wyir It has 715 entries. When I make the GET call however, it only returns 463 entries. var map =…
Matt Vaccaro
  • 318
  • 3
  • 9
2
votes
3 answers

Using $limit and $offset to get more than 1,000 rows on a SODA API

I am pulling data with a SODA API using the following code in Python response = requests.get('https://healthdata.gov/resource/uqq2-txqb.json') The dataset contains 434,865 rows but when I use the API, it only returns the first 1,000 rows. I saw on…
amatof
  • 175
  • 1
  • 13
2
votes
1 answer

Is there a way to get millions of records using sodapy in python?

I am trying to read in data from nyc opendata and it has about 25million records. def JSON_to_DF(json_file): json_data = requests.get(json_file) text_data = json.loads(json_data.text) pd_data = pd.DataFrame(text_data) return…
John_gis
  • 117
  • 8
2
votes
1 answer

Best way to download large datasets in Python?

I'm trying to use the Socrata API to download this dataset on 311 calls in NYC since 2010. The dataset is 22 million rows. I've never worked with APIs before, and am unsure of the best way to download this dataset - I've written a snippet of code…
Christine Jiang
  • 67
  • 1
  • 1
  • 6
2
votes
1 answer

Using Socrata API distance_in_meters() function with separate latitude, longitude field

I am trying to retrieve information about trees surrounding a given location from the Socrata API. API Endpoint Description I found two functions within_circle(...) and distance_in_meters(...) which I could use to filter the data set. The problem…
Tantalos
  • 119
  • 1
  • 8
2
votes
2 answers

SODA API Filtering

I am trying to filter through ny gov open database with their SODA API. I am following the docs on how to filter, but it is returning an empty dataframe. # noinspection PyUnresolvedReferences import numpy as np # noinspection…
GSatterwhite
  • 301
  • 1
  • 3
  • 12
2
votes
3 answers

Python - Pandas Describe Throwing Error: unhashable type 'dict'

Update: I am using some example code from "Socrata Open Source API." I note the following comment in the code: # First 2000 results, returned as JSON from API / converted to Python # list of dictionaries by sodapy. I am not v. familiar with…
GPB
  • 2,395
  • 8
  • 26
  • 36
2
votes
1 answer

Trouble putting together a SoQL query with Socrata

I have this query that I put together in MySQL in my test db and am trying to figure out how to port it over to the SoQL SODA API. Pretty much just trying to get a list of the unique business and associated details. SELECT DISTINCT (CAMIS), dba,…
Zeratas
  • 1,005
  • 3
  • 17
  • 36
2
votes
2 answers

how to convert text to number in a SOQL query?

Can somebody please help me figure out what is wrong with this query? https://data.cityofnewyork.us/resource/i4gi-tjb9.json?$where=speed<10 It failed with error code: query.soql.type-mismatch the "speed" column of the table is declared as text. I am…
Andrew Tang
  • 111
  • 1
  • 5
2
votes
0 answers

Error requesting API "failed to establish a new connection"

Got an interesting error that could very easily be user problem. I'm trying to access an API used by the Washington Public Disclosure Commission. It uses Socrata and because I'm using Python I'm using the sodapy package. The error…
elyorte
  • 21
  • 2
2
votes
1 answer

Querying from Soda database using Socrata client.get in Python

I am trying to query from a database and I've tried to lookup the right way to format an SoQL string but I am failing. I try the following: from __future__ import division, print_function from sodapy import Socrata import pandas as pd import numpy…
jtorca
  • 1,531
  • 2
  • 17
  • 31
2
votes
1 answer

Android Gradle duplicate files copied exception

I have seen many versions of this question where the solution is to simply exclude the META-INF file name, but those are already excluded and the duplicate file, in this case, is not even a file associated with META-INF. When I run ./gradlew…
1
2 3
15 16