Skip to main content

apiverve_htmltotext 1.2.5 copy "apiverve_htmltotext: ^1.2.5" to clipboard
apiverve_htmltotext: ^1.2.5 copied to clipboard

HTML to Text extracts clean plain text from raw HTML markup, reporting word counts and character counts. It identifies main article bodies automatically, records the extraction method used, and notes [...]

HTML to Text API - Dart/Flutter Client #

HTML to Text extracts clean plain text from raw HTML markup, reporting word counts and character counts. It identifies main article bodies automatically, records the extraction method used, and notes whether parsing succeeded.

pub package License: MIT

This is the Dart/Flutter client for the HTML to Text API.

Installation #

Add this to your pubspec.yaml:

dependencies:
  apiverve_htmltotext: ^1.2.5

Then run:

dart pub get
# or for Flutter
flutter pub get

Usage #

import 'package:apiverve_htmltotext/apiverve_htmltotext.dart';

void main() async {
  final client = HtmltotextClient('YOUR_API_KEY');

  try {
    final response = await client.execute({
      'html': '<!doctype html> <html>  <head> <title>This is the title of the webpage!</title> </head> <body> <p>This is an example paragraph. Anything in the <strong>body</strong> tag will appear on the page, just like this <strong>p</strong> tag and its contents.</p> </body> </html>'
    });

    print('Status: ${response.status}');
    print('Data: ${response.data}');
  } catch (e) {
    print('Error: $e');
  }
}

Response #

{
  "status": "ok",
  "error": null,
  "data": {
    "text": "This is an example paragraph. Anything in the body tag will appear on the page, just like this p tag and its contents.",
    "parsed": true,
    "extractionMethod": "article",
    "detectedLanguage": {
      "language": "english",
      "confidence": 0.3507446808510638
    },
    "characterCount": 118,
    "wordCount": 23
  }
}

API Reference #

Authentication #

All requests require an API key. Get yours at apiverve.com.

License #

MIT License - see LICENSE for details.


Built with Dart for APIVerve

0
likes
0
points
919
downloads

Publisher

unverified uploader

Weekly Downloads

HTML to Text extracts clean plain text from raw HTML markup, reporting word counts and character counts. It identifies main article bodies automatically, records the extraction method used, and notes whether parsing succeeded.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

http, http_parser

More

Packages that depend on apiverve_htmltotext