Extracting Content

If you have not tried out the API, then head to the try out page. All you have to do is provide a link and click a button.

Basic Usage

To use the API in code, all you have to do is make a request to our API. The following snippet is an example of a simple GET API call to extract the contents of the page you specified in the query string variable. The header, version, is required for all requests to the API and the header value is v1.

When using this API without any API key, calls are rate limited per IP address to 1 API call every 5 minute.

Request Params

Single-page applications require execution of javascript code to fully load the page content. To handle such pages, there is a boolean request parameter,renderJs, that should be set to true or false in requests accordingly.


Authenticated Usage
To get more frequent access to the API without the restrictions that come with the free tier, you have to subscribe so that you can create API keys that you use in your request. To do this:
  1. Sign up for an account.
  2. Subscribe to a package from your account.
  3. Create an API Key

    Once we have a subscription, we can then go ahead to the API key page to create an API key. This API key is what we use when querying the API. You can query the API without a key but this rate limits you to just one request per minute.

  4. Query with API Key

    Once we have created an API key, we can then query the nghota API using the api endpoint, api.nghota.com. The request is a GET request and should include the api key in a header with header name apiKey. The url that we wish to extract content from must be supplied as a GET request param. The snippet below shows an example of querying the api with a key using python.

    The API response will be the main content of the page that the url points to.

    {"content": "Example Domain. This domain is for use in illustrative examples in documents...", "url": "https://example.com"}
        

    You can access the content key just as you would access any json response. The rate limits are determined by the kind of subscription that is associated with the API key that is used.