Download a relation using XAPI

I’m trying to use XAPI to download a relation by using its unique id.

I’ve tried[ref=383665] and …/relation[id=383665] but neither work. I get an empty file.

If I use …/relation[name=Howardian Hills] then it works ok but I’d rather use the unique reference number.

What am I doing wrong? It’s late and I’ve had a long week!


I don’t think this is possible using Xapi. But you can do this using the standard API.
eg to download the XML for that relation, use:
You can get this by going to the browse page for that relation, then the “Download XML” link at the bottom of the page. eg

Though note this doesn’t include the members of the relation as Xapi does, only the relation itself.

If the relation is listed on a page on the wiki (example:, you can click the “j” link to open it in josm.

I tried this but it didn’t work - it couldn’t find the server http://localhost:8111/import?url=

Do I need to configure something?

I don’t think so - you had josm already open, right?

open the relation page , copy the link from “download xml” into the clipboard, open josm, press ctrl+L , paste the URL with ctrl+v and append a /full at the end to download all members.
( )

“Do I need to configure something?”
Yes, you need the JOSM remote plugin.

Thanks NE2 and Nightdive.