Looking at Pseudocode to walk the tangle?, in order to walk the tangle you look at the open tips and then you look for the parents. getTips gives you a list of all the open tips. What API call is needed however to get the parents?
The 2 parents of a transactions are called trunk transaction and branch transaction.
You get them like this: (It's python but the names and arguments in other libraries are very similar)
getTips returns a list of transaction hashes
tips = api.get_tips()['hashes']
getTrytes to fetch a transaction from its hash. (
tips for the first transaction in
transaction_trytes = api.get_trytes([tips])['trytes']
Transaction.from_tryte_string takes the trytes and casts them into a
transaction = Transaction.from_tryte_string(transaction_trytes)
To get the parents, use the properties of the transaction
trunkTransactionHash = transaction.trunk_transaction_hash() branchTransactionHash = transaction.branch_transaction_hash()
Then you can call
trunkTransaction = api.get_trytes([trunkTransactionHash])