Take the 2-minute tour ×
Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. It's 100% free, no registration required.

A while ago I made a little "Recently answered on Stackoverflow" sidebar widget for my homepage. Currently this works by filtering answers out of the user feed however I thought I'd update it to make use of the API instead.

I can successfully retrieve /users/{id}/answers however there doesn't seem to be a field for an answer's URL so is the way to do this just to concatenate

"http://www.stackoverflow.com/questions/" + question_id + "/" + 
  answer_id + "#" + answer_id

This is fine but it doesn't include the URL-friendly version of the question title so if I wanted that in the URL would I have to generate it myself?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

You have to generate any links back to "proper" SO yourself. The most any of the API methods will give you is (relative) links to other API methods.

share|improve this answer
1  
Out of curiosity, why isn't this included as part of the api? It seems like a common enough use case (for example, I need to get the url of an answer object that I just got from the api). –  Edan Maor Jun 13 '10 at 20:58

As of version 2.0 of the API, answers can return a link field in the response, which can be returned in the response by creating a filter that includes it:

enter image description here

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .