Skip to content

Includes

Kyle Piira edited this page Oct 22, 2017 · 1 revision

The AskSteem API will return some default fields such as title,name,summary, etc. for each search result, however, you may want to retrieve more different information. The includes parameter allows you to pass a CSV list of fields that should be returned for each result if available.

For example: https://api.asksteem.com/search?q=asksteem&include=meta will include the json_metadata for each post returned in the results.

Here is the JSON response:

{
	"pages": {
		"current": 1,
		"has_previous": false,
		"has_next": true
	},
	"error": false,
	"hits": 325,
	"results": [{
		"summary": "Hello, everyone!\nToday I'm releasing the AskSteem API v1.1 which brings tons of new features for developers to play with in their apps. \nWhat is AskSteem\nAskSteem is a powerful and fast search engine that indexes the steem blockchain. You can find out what AskSteem is capable of here\nWhat is the AskSteem API\nThe 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.\nWhat",
		"children": 99,
		"created": "2017-08-19T21:44:33",
		"tags": ["asksteem", "steem-dev", "steem", "search", "api"],
		"permlink": "asksteem-api-v1-1-update-user-search-includes-and-sorting",
		"meta": {
			"users": ["hoxly"],
			"links": ["https://www.asksteem.com", "https://steemit.com/steemit/@thekyle/introducing-asksteem-a-steem-search-engine", "https://steemit.com/asksteem/@thekyle/asksteem-search-api-docs"],
			"tags": ["asksteem", "steem-dev", "steem", "search", "api"],
			"image": ["https://cdn.hoxly.com/asksteem/attribution.png"],
			"app": "steemit/0.1",
			"format": "markdown"
		},
		"type": "post",
		"net_votes": 410,
		"title": "AskSteem API v1.1 Update - User Search, Includes, and Sorting",
		"author": "thekyle"
	}, {
		"summary": "Hi, Steemians! \nA popular missing feature here on steemit is the ability to quickly and easily find posts that mention you using the @username syntax. This functionality comes baked right into AskSteem, a steem search engine. I wanted to write a quick blog post showing you how easy it is the utilize this powerful capability to interact with those who are talking about you in their posts.\n\n\n1. Go to AskSteem.com\n\nTo use this service you will need to visit AskSteem\n2. Type Your Username in Quotes\n",
		"children": 85,
		"created": "2017-06-14T02:02:48",
		"tags": ["steemit", "asksteem", "steem", "steemdev", "mentions"],
		"permlink": "how-to-find-posts-that-mention-you-with-asksteem",
		"meta": {
			"image": ["https://steemitimages.com/DQmRSGdQWR8KuVNbGWm91z9jQrtWDCyAvL57EkaUkiKWw96/image.png", "https://steemitimages.com/DQmYDyQ1Ft3rX8Rk9VzfpbWeNWAPwTApYsiLa4YTx4BdmNj/image.png", "https://steemitimages.com/DQmemedFbLPQ8oKja5dhmWjFoPWTqTXhKvjSgE44cfAUaWq/image.png"],
			"app": "steemit/0.1",
			"links": ["https://www.asksteem.com", "https://steemit.com/steemit/@thekyle/introducing-asksteem-a-steem-search-engine"],
			"tags": ["steemit", "asksteem", "steem", "steemdev", "mentions"],
			"format": "markdown"
		},
		"net_votes": 310,
		"title": "How to Find Posts that Mention You (with AskSteem)",
		"type": "post",
		"author": "thekyle"
	}],
	"time": 0.097
}

This also works on user results like so: https://api.asksteem.com/search?q=thekyle&types=user&include=following

Would result in this JSON response:

{
	"pages": {
		"current": 1,
		"has_previous": false,
		"has_next": false
	},
	"error": false,
	"hits": 1,
	"results": [{
		"type": "user",
		"created": "2017-01-15T03:04:42",
		"followers_count": 627,
		"rep": 57.35,
		"name": "thekyle",
		"following": ["andrarchy", "fabien", "furion", "good-karma", "heimindanger", "hoxly", "jesta", "officialfuzzy", "resteembot", "shango", "zappl"],
		"post_count": 290,
		"following_count": 11
	}],
	"time": 0.067
}
Clone this wiki locally