AskSteem API v1.1 Update - User Search, Includes, and Sorting

in #asksteem7 years ago (edited)

Hello, everyone!
Today I'm releasing the AskSteem API v1.1 which brings tons of new features for developers to play with in their apps.

What is AskSteem

AskSteem is a powerful and fast search engine that indexes the steem blockchain. You can find out what AskSteem is capable of here

What is the AskSteem API

The AskSteem API is a RESTful HTTP API that allows developers to integrate search functionality into their applications easily. To learn more about the AskSteem API v1.0 read this post.

Whats New

The AskSteem API v1.1 brings loads of new functionality that has been requested by developers.

Includes

You can now tell AskSteem to return specific fields for each search result so you don't have you query the blockchain yourself for additional data. By default the AskSteem API returns title,summary,net_votes,children,permlink,created, and tags fields for each result. However, you can now use the include URL parameter to include specific fields that are not returned by default.

For example, to include the json_metadata field for each result use the following:
https://api.asksteem.com/search?q=asksteem&include=meta
This will return results that look like this:

{
        "children": 89,
        "type": "post",
        "permlink": "introducing-asksteem-a-steem-search-engine",
        "meta": {
            "format": "markdown",
            "app": "steemit/0.1"
        },
        "tags": ["steemit", "steem", "asksteem", "steem-project", "steemdev"],
        "author": "thekyle",
        "summary": "\nHello, Steemians!\nOver the past month, I've been building a new search engine that indexes the steem blockchain. It's currently live at asksteem.com. The goal of AskSteem is to provide a reliable, powerful, and fast search engine that is optimized for steem. In this post, I'd like to cover some of the features that are available. \nQuery Syntax\nThere are many different ways that you can query the AskSteem index. I've created a video demonstrating each of them, but you may also read their descrip",
        "net_votes": 300,
        "created": "2017-06-03T19:07:45",
        "title": "Introducing AskSteem - A steem search engine"
    }

The include parameter can take only one value or multiple values seperated by commas.

User Search

When the AskSteem API originally launched it only supported searching posts on the blockchain, not users like from the regular AskSteem.com interface. But with v1.1 developers can now tap into our user database with the types URL parameter.

To include users and posts in search results use the following:
https://api.asksteem.com/search?q=steem&types=post,user
or for only users:
https://api.asksteem.com/search?q=steem&types=user
The results would look like:

{
        "followers_count": 226,
        "name": "steem",
        "rep": 25,
        "created": "2016-03-24T17:00:18",
        "post_count": 0,
        "type": "user",
        "following_count": 0
}

User results also support the includes parameter for fetching additional fields about users.

Sorting

This new version of the API supports custom sorting of results by a field with two new URL parameters sort_by and order. The sort_by parameter takes the name of the field you would like to use for sorting, for example, created (for creation date) or net_votes (for the number of votes). The order parameter determines how the field is to be sorted and accepts either desc or ascfor descending and ascending respectively.

For example to sort results by most recent use the following:
https://api.asksteem.com/search?q=steem&sort_by=created&order=desc
To sort results by most comments use this:
https://api.asksteem.com/search?q=steem&sort_by=children&order=desc
The default value of order is desc so it can be left out like below:
https://api.asksteem.com/search?q=steem&sort_by=net_votes

Restrict Search Results to App

While this is not a new feature of the API and was available in v1.0 and the standard AskSteem.com interface it was not documented. To restrict search results to a specific app use the following query syntax:
meta.app:appname AND query goes here

How to Upgrade

If you used the AskSteem API v1.0 in your app then you have already been transitioned to using this new version. The AskSteem API v1.1 is fully backward-compatible with v1.0.

Summary

Here is a table to summarize the parameters of the API.

paramdescriptiondefault
qtakes the search term to query for.None
pgtakes the page number1
includetakes a CSV list of additional fields to returnNone
typestakes a CSV list of types of items to return (post/user)post
sort_bytakes a single field to be used for sorting the results_score
ordertakes either desc or ascdesc

Required Attribution

We require that all applications using the API place AskSteem branding on the search results page in a location that is immediately visible to the user without any interaction on their part. Additionally, to ensure reliability and uptime we request that you send between 1% and 2% of post beneficiary rewards to the @hoxly user account if applicable to your app.

Branding Examples:

Here is an example of some HTML code to embed AskSteem branding:
<a href="https://www.asksteem.com"><img src="https://cdn.hoxly.com/asksteem/attribution.png" width="100px"></a>

Preview:

Thank you, and happy searching!

Sort:  
There are 2 pages
Pages

this is great. i must try this one. it seems like user friendly. anyway

WOW ! Really a great initiation. Appreciated...

Great API! I am a developer I found it very useful! I will use it! thanks for the info!

Great! Send me the link to whatever you build with it. :)

mmhmm

Let me guess. Your're thinking right????

Adrian M you are incredible. I am not a programmer or coder, but I appreciate what you are doing enormously! Thank you. You and other coders produce valuable tools we can use.

I wanted to thank you here for the work you've done with DTube. I love it! You are off to a great start. I did a video on DTube recently and posted it here on Steemit. You'll notice that you figure prominently in it.

I loved the interview you did with my friend Dan Dicks of Press For Truth. Would you be open to an interview with me so I could spread your message on what you've done with DTube?

Here is the link to the video I did so you can see it.

https://steemit.com/dtube/@terrybrock/n1108mgs

Thank you for what you are doing to help us. Keep up the good work!

Terry

Hi Terry,
Thank you for your kind words, however, I believe you meant this message to be for a friend of mine @heimindanger (Adrian M), not me. That said I am the lead developer behind AskSteem, so if you have any questions regarding that project do let me know.

Yes, my mistake, thekyle. Thank you for your help.

Love your API and plan on using it on a future project.

Can't wait to see what you do with it! :)

WOW! You set a high bar with this one !!

Glad to see this going so well!

Thanks. :)

Wow, this sounds really cool! Question, I noticed you earn a lot per post. I currently have been getting $0.02 per post lol! Would I earn more if I had more Steem Power?

Steem power determines how much your individual vote is worth (mine is worth about 5 Steem Cents right now). While there are some accounts that have upvotes worth hundreds of dollars those are rare. If you want to make more money I'd recommend to just keep producing quality content that people want to read. :D

Wow, thanks a lot for replying, man! I really appreciate it!

That is an extremely useful tool. Thanks for investing your time into it.

Will we ever see this integrated into the Steemit.com platform instead of the Google search?

I have discussed this with Steemit.com however, they prefer the Google search.
https://github.com/steemit/condenser/pull/1599

That is very disappointing. It tells me much about the Steemit.com development team. They will never develop this site much further.

Your search should be built in, chat should be built in...

OK I consider my question answered then :(

Google really sucks for Steemit, you'll almost always get old posts. With all due respect, Steemit as a front-end is not much to write home about. I'd switch to a different front-end in the blink of an eye. More so if they have a night mode! Ie. dark background and light text.

You might want to check out Busy.org if you haven't already seen it! :)

Thanks, I've seen it just briefly, will check it out. I just asked in #lookingforniche if we could find users which use a particular tag like us with AskSteem, I think we could no?

Itd good resllly

Thank you so much for taking the time and effort to develop this app! I am not proficient enough with coding to make a Steem app yet (hopefully I will be within the coming year). I so admire programmers who try and eventually succeed because I think that programming can be so frustrating even when it is fun. Keep up the great work, please!

I plan to make some tutorial posts about developing apps on the steem blockchain at some point so make sure to stay tuned for those. :)

I found the video about AskSteem that you put on DT really helpful. Thank you. Also, following you now.

Glad I could help.

I would really appreciate a tutorial post on steem blockchain programming, please do, willl follow you, i am a programmer.

Is there anything specific you would like to see?

Thanks for asking, let's start with choosing the programming language before we go any further :-). I am kind of old school, can do anything but have spent 25 years of my life in some exotic crossplatform crossdatabase language called Omnis. I really feel like having some fun and doing something with Steem blockchain, what language am i looking at? C++?
Will be very grateful if you just tell me the language to start with, i hear there is even a js api for Steemit. I am asking you more for a favour to give me a 1 word advice, hope you understand that i can probably only follow and upvote you for the first 6 months and have to learn a new language first. With love, thanks!

If you want to do frontend development then learn JavaScript and use SteemJS
If you want to do backend development then learn Python and use Steem-Python or Piston

Very good tool, I am thinking also if someone can create a option to save some posts as a bookmark, sometimes there are so amazing post that I want to read again and again but not having time to comment i just lose them, I hope something will be done from some developer

I've received several requests for this feature so it's definitely on the to-do list.

Class- 10 points for this great support and development 2U

I love it man! I use AskSteem almost every day. I secretly hope Steemit Inc. will use AskSteem for search instead of Google! Any news on that? Answered

Thanks to @Dtube for resteeming!

Finally a real Steem Search not through Google. I've tried it few minutes ago and enjoy it. Re-steeemed and shared.

Excellent comment, I really like your work. I think it is very objective in the analysis and in what you want to convey. Thank you for sharing your knowledge with us.


life is a coder keep it up

A great help to spread out the platform...Thanks to people behind this project.

This is some really good stuff. Good luck with everything!

We are waiting for the new one to be launched

It is already launched.

Very nice contribution to the community. Thank you!

Excellent post : congratulations

WOW Great stuff!!

To help asksteem becoming a search engine of the future next to presearch.io we as steemians can do it own part. We need to contribute value often. I try asksteem if it has a capability to search outside steem network content but it fail. It means as stated it only search the steem index by

Resteemed for later, might be able to use that when I become more familiar with the steem community

Awesome stuff thankyou for your hard work

I am so glad the user search is on this api. Lots of people have been asking for this.

Thank you for providing new information to the friend of steemit @thekyle
don't forget to follow me @hattaarshavin

Resteeming this will be too worth for this post..

Started visiting your blog for new feeds...
Stay blessed @thekyle

Great people on great STEEMIT, doing great jobs. I like this.

This is really cool. We need ways to find the good content in our interests and this is a great tool for that. Thanks

Wow! Great post,and excellent planning of your project, congratulations my friend.

Inspire man

Congratulations @thekyle!
Your post was mentioned in the hit parade in the following category:

  • Pending payout - Ranked 6 with $ 222,67

Thats a great Articles...but if anybody has answer to the following question it will be great help..

https://steemit.com/facebook/@lifeisfun/question-making-money-with-no-of-likes-on-facebook-for-steemit-posts

@thekyle Good afternoon, my project is very good and I would like you to give me permission to make a post for the Spanish community with its content since it is very good. In the post would make mention that you are the main author of this project. I hope your kind reply to the translation permission of your post. Thank you and goodbday friend

Yeah sure, go ahead.

Friend thank you very much for authorizing me, you suddenly use pastebin to give me the link.

This post is useful for all of us on Steemit. And I will try to look at the AskSteem you propose to. Regard.feom Aceh.

Nice ! What components are you using for the backend ?

We are using a custom version of ElasticSearch with our own ranking algorithm. Also custom systems for caching, load-balancing, automatically scaling, crawling the blockchain, etc.

Wow, this is amazing. I had no idea that developing something with these features was a possibility. Nice work!

Well, it certainly wasn't easy but I think it's worth it for the steem community.

Great effort @thekyle... Keep on posting and sharing good stuff here....

Awesome interview!

Why not taking of the .com,, just put Ask Steem without the .com, I think its better

FOLLOWED, UPPED and RESTEEMED

Upvote this Comment for More Resteems

Hello and thanks a lot for this great tool.

Is it intentional that the API returns multiple hits? Apparently, it is.

Check this post for details:
https://steemit.com/asksteem/@ervin-lemark/asksteem-api-v1-1-returns-multiple-result-sets-when-query-string-includes

-Excellent post thanks for sharing
I am a new steemians, maybe i should study first with you, regards know me
https://steemit.com/@cartoonhd please follow me
I followed and upvoted.Would you like to follow and upvote me.
DQmRKgYYp1TzWmvqtnfbMSLZQSgUXinUxqyHyd39HZ8j7gx.gifDQmeEhY3iMJiyRhGjAM6aaUDfSuam7F722fD6iwqyWxVBMB_1680x8400.png

There are 2 pages
Pages