Search packages, repositories and app categories

Package detailsv1.2.0+1

wordpress_api

A WordPress REST API client for dart with support for WooCommerce and custom namespaces.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
90
Likes
102
Pub points
145

Install package

flutter pub add wordpress_api

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Dart package that provides a client for the WordPress REST API, supporting WooCommerce and custom namespaces. It enables seamless integration with WordPress sites across multiple platforms, including mobile and web. The package simplifies authentication, data fetching, and handling of complex API responses, making it ideal for developers building apps that interact with WordPress-powered content or e-commerce systems. With official support for Android, iOS, Web, macOS, Windows, and Linux, it ensures cross-platform compatibility. The source code is publicly available on GitHub for transparency and community contributions.

Use cases

  • Building mobile apps for WordPress blogs
  • Integrating WooCommerce stores into Flutter apps
  • Fetching custom post types from WordPress
  • Creating content-driven web applications
  • Connecting to WordPress with custom API endpoints

Key features

  • Support for WooCommerce APIs
  • Custom namespace handling
  • Cross-platform compatibility
  • Authentication utilities
  • Robust error handling
  • Type-safe response parsing

Suitable for

  • Flutter developers working with WordPress
  • E-commerce app creators using WooCommerce
  • Content management system integrators
  • API-first application builders
  • Teams requiring multi-platform WordPress integration

Considerations

  • Requires familiarity with WordPress REST API structure
  • May need additional setup for custom endpoints
  • Depends on external WordPress site configuration
  • Limited documentation beyond basic examples
  • Not suitable for direct WordPress admin operations

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

WordPress REST API client for Dart | Flutter

All Contributors

GitHub stars Pub Build Status Maintenance

Description

A WordPress REST API client for dart with support for WooCommerce and custom namespaces/endpoints.

Features

  • Retrieve data from standard WordPress endpoints.
  • Retrieve data from any custom namespace

Installation

In the dependencies: section of your pubspec.yaml, add the following line:

dependencies:
  wordpress_api: <latest_version>

Usage

  • Import the package
import 'package:wordpress_api/wordpress_api';
  • Initialize WPAPI
  WordPressAPI api = WordPressAPI('wp-site.com');
  • Retrieve posts from .posts getter

    • You can fetch a list of posts by simply calling .posts. More arguments can be passed to further filter the data returned
      void main() async {
        final api = WordPressAPI('wp-site.com');
        final WPResponse res = await api.posts.fetch();
        for (final post in res.data) {
          print(post.title);
        }
      }
    
    • As of v0.3.0, you can query a single post from the same endpoint by passing an id
      void main() async {
        final api = WordPressAPI('wp-site.com');
        final WPResponse res = await api.posts.fetch(id: 1);
        print(res.data.title);
      }
    
  • Retrieve data from a custom endpoint

  void main() async {
    final api = WordPressAPI('wp-site.com');
    final WPResponse res = await api.get(endpoint: 'your-custom-endpoint');
    print(res.data);
  }

ToDo

  • Authentication using Application Passwords. WordPress 5.6+ only
  • Fully integrated WooCommerce support.
  • Full CRUD operations.
  • Support for other popular WordPress Plugins.

Contributions are welcome, report any issues here

Special Thanks

Contributors ✨

Thanks goes to these wonderful people (emoji key):

anKii
anKii

💻
Kellvem Barbosa
Kellvem Barbosa

💻
NKlage
NKlage

💻 🐛
Elikem (Junior) Medehou
Elikem (Junior) Medehou

💻
Okan Demir
Okan Demir

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Categories

Dependencies

Dependency list 4 items

Source repository

Projects using this package

No data available yet.