wikitree / wikitree-api

Documentation and examples for using the WikiTree.com API
23 stars 10 forks source link

Suggestion: API call to return connection between two profiles #12

Open faceless2 opened 2 weeks ago

faceless2 commented 2 weeks ago

First issue, let's hope this is the right place for this. If not here, where?

I have a suggestion: adding a method to the API which would allow the relationship between two IDs would open up all sorts of interesting options for visualizers (including SlippyTree)

Something like

curl 'https://api.wikitree.com/api.php?action=getConnections&key1=Clemens-1&key2=Windsor-1&type=shortest'

[
  {
    "connections": [
      [
         {
           "Id": 5185,
           "Name": "Clemens-1"
         },
         {
           "Id: 5186,
           "Name": "Clemens-2",
           "relationship": "mother"
         },
         ...
         {
           "Id: 1234,
           "Name": "Windsor-1",
           "relationship":"daughter"
         }
       ]
    ]
  }
]

Returning an array of connections (to cater for there being more than one), and otherwise essentially presenting the same information we get on https://www.wikitree.com/index.php?title=Special:Connection

bcaseyrls commented 2 weeks ago

This is a fine place for such a suggestion. Adding a "getConnections" action to the API is something that has come up before. It's in our queue to consider. I've added a note that another request/suggstion for it has been made.

On Nov 15, 2024, at 9:12 AM, Mike Bremford @.***> wrote:

First issue, let's hope this is the right place for this. If not here, where?

I have a suggestion: adding a method to the API which would allow the relationship between two IDs would open up all sorts of interesting options for visualizers (including SlippyTree)

Something like

curl 'https://api.wikitree.com/api.php?action=getConnections&key1=Clemens-1&key2=Windsor-1&type=shortest'

[ { "connections": [ [ { "Id": 5185, "Name": "Clemens-1" }, { "Id: 5186, "Name": "Clemens-2", "relationship": "mother" }, ... { "Id: 1234, "Name": "Windsor-1", "relationship":"daughter" } ] ] } ] Returning an array of connections (to cater for there being more than one), and otherwise essentially presenting the same information we get on https://www.wikitree.com/index.php?title=Special:Connection