In action=parse, when getting prop=sections, each section has a byteoffset field. However, that field does not contain a byte offset, but rather a Unicode codepoint offset.
This is extremely misleading! There are two complaints (one by me just now) about this on the action=parse talk page: https://www.mediawiki.org/w/index.php?title=API_talk:Parsing_wikitext&oldid=5499602#%22byteoffset%22_is_a_misnomer
In an ideal world we would rename the field, but I think all we can do now is add a note to the documentation for action=parse.
@cscott: The correct information is available via TOCData, we should export that and deprecate sections.