Crawlzodocs
Guides

Nulls and zeros

Why a metric comes back null, and why that is deliberate.

A null metric means the platform did not publish that number. A 0 means the platform published zero. These are different facts and we never substitute one for the other.

It would be easy to return 0 everywhere and make the schema look tidy. It would also mean your averages are wrong and you cannot tell a post nobody liked from a post whose likes are hidden.

What to do with it

Filter nulls out before you aggregate. In most analysis a null row should be excluded rather than counted as zero.

views = [p["view_count"] for p in posts if p["view_count"] is not None]
average = sum(views) / len(views) if views else None

If you are writing to a database, keep the column nullable. Coercing to zero at the storage layer throws away the distinction permanently.

Common cases

Instagram publishes a view count for video. Photo and carousel posts do not have one, so view_count is null rather than zero.

Share and save counts are visible only to the account that owns a post, on every platform we cover. No public surface carries them, so they are never populated. An endpoint that returned a number there would be inventing it.

YouTube hides some counts on some surfaces. Where a number is not published we return null rather than the rounded figure shown on the page, because a rounded figure is not the number.

Weibo's search results withhold engagement counts entirely. Those fields come back null and the response says so. Read a post through the details endpoint to get its counts.

Some platforms round large numbers on listing pages, showing "1.2M" instead of an exact figure. Where a response carries a rounded value, it is flagged as approximate rather than presented as exact.

Empty lists

An empty array is its own answer. It means the surface was read and held nothing, which is different from the surface being unavailable. When a surface cannot be read at all you get an error, not an empty list, so you are never left guessing which happened.

On this page