Microformats: HTML API
AlchemyAPI provides easy-to-use facilities for extracting Microformats-formatted structured data from any web page: Post (upload) any content directly to our service for analysis, and Microformats will be extracted automatically.
These API calls may be utilized to process posted (uploaded) webpages and other HTML content. If you are processing content hosted on a publicly accessible website, consider using our URL processing calls instead.
API Call: HTMLGetMicroformatData
Description: The HTMLGetMicroformatData call is utilized to extract Microformats content from a posted HTML document. AlchemyAPI will process the posted HTML document, looking for a variety of Microformats data structures (hCards, geo, adr, etc.).
Endpoint: http://access.alchemyapi.com/calls/html/HTMLGetMicroformatData
Parameters:
| http argument | parameter description |
|---|---|
| apikey | your private api key
(required parameter) |
| html | HTML document content (must be uri-argument encoded)
(required parameter) |
| url | HTML document URL (must be uri-argument encoded)
(optional parameter, for response tracking purposes.) |
| outputMode | desired API output format Possible values: xml (default) json rdf (optional parameter) |
| jsonp | desired JSONP callback (optional parameter, requires "outputMode" to be set to json) |
Response Format (XML)
<results>
<status>REQUEST_STATUS</status>
<url>DOCUMENT_URL</url>
<microformats>
<microformat>
<fieldName>MICROFORMAT_FIELD_NAME</fieldName>
<fieldData>MICROFORMAT_FIELD_DATA</fieldData>
</microformat>
<microformat>
<fieldName>MICROFORMAT_FIELD_NAME</fieldName>
<fieldData>MICROFORMAT_FIELD_DATA</fieldData>
</microformat>
</microformats>
</results>
Response Format (JSON):
{
"status": "REQUEST_STATUS",
"url": "DOCUMENT_URL",
"microformats": [
"microformat": {
"fieldName": "MICROFORMAT_FIELD_NAME",
"fieldData": "MICROFORMAT_FIELD_DATA"
},
"microformat": {
"fieldName": "MICROFORMAT_FIELD_NAME",
"fieldData": "MICROFORMAT_FIELD_DATA"
}
]
}
Response Format (RDF):
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:aapi="http://rdf.alchemyapi.com/rdf/v1/s/aapi-schema#"
xml:base="http://rdf.alchemyapi.com/rdf/v1/r/response.rdf">
<rdf:Description rdf:ID="DOCUMENT_HASH">
<rdf:type rdf:resource="http://rdf.alchemyapi.com/rdf/v1/s/aapi-schema#DocInfo"/>
<aapi:ResultStatus>REQUEST_STATUS</aapi:ResultStatus>
<aapi:URL>DOCUMENT_URL</aapi:URL>
</rdf:Description>
<rdf:Description rdf:ID="DOCUMENT_HASH-m_MICROFORMAT_NUM">
<rdf:type rdf:resource="http://rdf.alchemyapi.com/rdf/v1/s/aapi-schema#MicroformatOccurrence"/>
<aapi:Doc>DOCUMENT_HASH</aapi:Doc>
<aapi:MicroformatName>MICROFORMAT_FIELD_NAME</aapi:MicroformatName>
<aapi:MicroformatData>MICROFORMAT_FIELD_DATA</aapi:MicroformatData>
</rdf:Description>
</rdf:RDF>
Response Fields:
| field name | field description |
|---|---|
| status | success / failure status indicating whether the request was processed. Possible values: OK ERROR |
| url | http url information was requested for. |
| microformat | structured microformats data (hCard, etc.) extracted from this web page. |
| statusInfo | failure status information (sent only if "status" == "ERROR"). Possible values: invalid-api-key page-is-not-html |
API Notes:
- 1. Calls to HTMLGetMicroformatData should be made using HTTP POST.
- 2. HTTP POST calls should include the Content-Type header: application/x-www-form-urlencoded
- 3. Posted HTML documents can be a maximum of 600 kilobytes. Larger documents will result in a "content-exceeds-size-limit" error response.
- 4. If the processed HTML document does not contain any Microformats data structures, an empty result-set will be returned.
- return to top of page -
