ndmitchell / hoogle

Haskell API search engine
http://hoogle.haskell.org/
Other
738 stars 134 forks source link

Improve hoogle api #120

Closed ckoparkar closed 8 years ago

ckoparkar commented 9 years ago

Hi, I am using Hoogle api to write an instant answer for duckduckgo. Here is a similar result for ruby gems. The current api returns the doc string and version in a same json field, which is not a problem but could be improved. We could also include several more details available on hackage like licence, downloads, source repository, author etc. Is there any plan to do this ? Does this fit in the project roadmap ?

ndmitchell commented 9 years ago

I'm currently working on Hoogle 5 hosted at http://hoogle.haskell.org. That doesn't yet have a JSON API, but tell me what you want and I'll see what I can do. It seems you want the metadata in explicit format where possible?

ckoparkar commented 9 years ago

Yeah it would be great to have maximum possible information in the API. It would make the search result much better. Ill keep checking for updates on hoogle 5 :smiley: . Thanks for such a quick response.

ndmitchell commented 9 years ago

Hmm, looking closer, the Ruby gems are only listing packages, whereas Hoogle searches functions etc. There is a lot less available metadata for functions etc. Are you hoping to just search packages? Or everything?

ckoparkar commented 9 years ago

Yeah everything, but depending on the type of result (package vs method signature) we are displaying it differently. Right now the difference is just packages have versions and methods don't. Do you think its possible to include its type in the API ? And if yes would we want to ?

ndmitchell commented 9 years ago

I want to include everything in the API. That way you can pick and chose what you display, and change it without needing to get more information from me.

ckoparkar commented 9 years ago

Sounds cool. Looking forward to it :smiley: . By when are you planning to release it ? It'll help us decide if we should integrate with the existing API or wait for Hoogle 5.0.

ndmitchell commented 9 years ago

I'm releasing the code and redeploying every night. I'll see how soon I can do some work on it - might not be that soon, or might be, just can't tell I'm afraid. I expect the API to be basically the same as Hoogle 4, at least in principle, so integrating with that would certainly get you started.

ckoparkar commented 9 years ago

Sure. Thanks so much. I've already created an instant answer with the existing API. It is under review. I'll keep checking for updates on Hoogle 5.

cordawyn commented 8 years ago

@ndmitchell If you don't mind my 5 cents, may I suggest that you rely on HTTP "Accept" header to produce corresponding output format instead of "mode=" parameter? (E.g. clients sending "Accept: application/json" header want JSON output). Could you make it so in Hoogle 5 at least? :-) Thank you!

ndmitchell commented 8 years ago

@cordawyn I like to have mode= so I can easily test it from the browser. I'm happy enough to make Accept provide a default mode, so you still get what you want.

ckoparkar commented 8 years ago

@ndmitchell I haven't worked with this for a long time. Closing this issue :-)