NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

7
2

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
684212941
accept rate: 11%


10

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 ♦
19.5k16156280
accept rate: 22%

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

I wrote a script to query this API to obtain all changesets for a user https://github.com/andrewharvey/osm-get-user-changeset-metadata

(02 Nov '20, 21:47) aharvey
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:

×290
×127
×57

question asked: 07 Jun '13, 07:47

question was seen: 6,910 times

last updated: 02 Nov '20, 21:47

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum