3

I'm trying to use https://data.stackexchange.com/stackoverflow/atom to get stackoverflow data. But I have some problems.

One of my request is to get the posts with specific tags, for example odata. (I want posts with tags contains odata, not just posts just with tags odata). And I tried the odata official url request:

https://data.stackexchange.com/stackoverflow/atom/Posts?$filter=contains(Tags, 'odata')

Then I got this error:

Unknown function 'Contains' at position 0.

So my question is: Is there an easy way to query the data using stackoverflow odata endpoint?

1 Answer 1

0

Data Explorer only supports up to OData version 2, but the contains function was added sometime after that (either version 3 or 4). You can view the list of supported $filter functions on the OData website.

Note that the OData endpoints have generally been deprecated in favour of the Stack Exchange API, which offers a more convenient and reliable way to get at the data, so it's unlikely that support for later OData versions will be added to Data Explorer.

That said, for your particular query, you can just use the indexof function instead. For example: /Posts?$filter=indexof(Tags,'odata') gt -1

answered Mar 10, 2014 at 14:20
4
  • Thanks for clarify. One more question on odata endpoint for stackoverflow. Is there a limit on records returned from a request? When I run /Posts/$count, I got 18942008, but when I run /Posts, I got definitely less than 18942008 records. Is that due to some paging in OData or limit on the service? Commented Mar 11, 2014 at 1:49
  • Yeah, I believe the default page size is 50. Commented Mar 11, 2014 at 3:18
  • 3
    @TimStone Are the odata links dead now? Following the links from data.stackexchange.com gives Page Not Found responses. Commented Oct 22, 2014 at 1:21
  • @DanielBallinger: a late reply, but the answer appears to be yes. Commented Sep 2, 2015 at 18:53

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.