The main api only returns 100 changesets, but the user has more than that, how can all of their changeset be queried?

asked 07 Jun '13, 07:47

amritkarma's gravatar image

amritkarma
624212841
accept rate: 11%


You would have to get them 100 at a time. For example

http://api.openstreetmap.org/api/0.6/changesets?display_name=EdLoach

returns my most recent 100 changesets. My 100th changeset (as I type) shows created_at="2013-04-19T09:29:30Z" So, my next 100 older changesets can be queried by:

http://api.openstreetmap.org/api/0.6/changesets?display_name=EdLoach&time=2001-01-01,2013-04-19T09:29:30Z

where the first time is "closed after" and the second time is "created before", so I picked an arbitrary "closed after" date before the project began. So to get the next 100 older changesets each time, use the created_by time from the last changeset returned from the previous query as the "created before" time for the next one. At some point you will either get fewer than 100 changesets returned, or an empty result (example here based on a "created before" date set before I began mapping) if a user has an exact multiple of 100 changesets.

permanent link

answered 07 Jun '13, 08:43

EdLoach's gravatar image

EdLoach ♦
16.4k14134236
accept rate: 23%

2

But see the http://wiki.openstreetmap.org/wiki/API_usage_policy and don't do this for many users.

(07 Jun '13, 10:02) gormo
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×201
×91
×40

question asked: 07 Jun '13, 07:47

question was seen: 2,733 times

last updated: 07 Jun '13, 10:02

powered by OSQA